rtc: rtctest: Change no IRQ detection for RTC_IRQP_SET
authorAndrey Smirnov <andrew.smirnov@gmail.com>
Tue, 21 Jun 2016 07:22:50 +0000 (00:22 -0700)
committerAlexandre Belloni <alexandre.belloni@free-electrons.com>
Sun, 26 Jun 2016 21:43:54 +0000 (23:43 +0200)
A call to ioctl(..., RTC_IRQP_SET, ...) 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>
tools/testing/selftests/timers/rtctest.c

index 97beadf..4230d30 100644 (file)
@@ -218,7 +218,7 @@ test_PIE:
                retval = ioctl(fd, RTC_IRQP_SET, tmp);
                if (retval == -1) {
                        /* not all RTCs can change their periodic IRQ rate */
-                       if (errno == ENOTTY) {
+                       if (errno == EINVAL) {
                                fprintf(stderr,
                                        "\n...Periodic IRQ rate is fixed\n");
                                goto done;