Browse Source

rtc: rtctest: Change no IRQ detection for RTC_IRQP_READ

A call to ioctl(..., RTC_IRQP_READ, ...) should never result in
ENOTTY. All new style RTC drivers implement it and all of the old style
drivers return EINVAL when they don't support periodic IRQs.

Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Andrey Smirnov 9 years ago
parent
commit
519efa9805
1 changed files with 1 additions and 1 deletions
  1. 1 1
      tools/testing/selftests/timers/rtctest.c

+ 1 - 1
tools/testing/selftests/timers/rtctest.c

@@ -200,7 +200,7 @@ test_PIE:
 	retval = ioctl(fd, RTC_IRQP_READ, &tmp);
 	retval = ioctl(fd, RTC_IRQP_READ, &tmp);
 	if (retval == -1) {
 	if (retval == -1) {
 		/* not all RTCs support periodic IRQs */
 		/* not all RTCs support periodic IRQs */
-		if (errno == ENOTTY) {
+		if (errno == EINVAL) {
 			fprintf(stderr, "\nNo periodic IRQ support\n");
 			fprintf(stderr, "\nNo periodic IRQ support\n");
 			goto done;
 			goto done;
 		}
 		}