提交 e21a47ff 编写于 作者: U Uwe Kleine-König 提交者: Alexandre Belloni

rtc: rtctest: enabling UIE for a chip that doesn't support it returns EINVAL

Calling ioctl(..., RTC_UIE_ON, ...) without CONFIG_RTC_INTF_DEV_UIE_EMUL
either ends in rtc_update_irq_enable if rtc->uie_unsupported is true
or in __rtc_set_alarm in the if (!rtc->ops->set_alarm) branch. In both
cases the return value is -EINVAL. So check for that one instead of
ENOTTY.
Signed-off-by: NUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: NAlexandre Belloni <alexandre.belloni@free-electrons.com>
上级 4d8318bc
...@@ -61,7 +61,7 @@ int main(int argc, char **argv) ...@@ -61,7 +61,7 @@ int main(int argc, char **argv)
/* Turn on update interrupts (one per second) */ /* Turn on update interrupts (one per second) */
retval = ioctl(fd, RTC_UIE_ON, 0); retval = ioctl(fd, RTC_UIE_ON, 0);
if (retval == -1) { if (retval == -1) {
if (errno == ENOTTY) { if (errno == EINVAL) {
fprintf(stderr, fprintf(stderr,
"\n...Update IRQs not supported.\n"); "\n...Update IRQs not supported.\n");
goto test_READ; goto test_READ;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册