rtc: make example code jump to done instead of return when ioctl not supported
Subsystems (2)
PATCH 1/2 rtc: make example code jump to done instead of return when ioctl not supported
Signed-off-by Hans-Christian Egtvedt <[email protected]>
--- Documentation/rtc.txt | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
Documentation/rtc.txt +1 -1
@@ -388,7 +388,7 @@ test_PIE: /* not all RTCs support periodic IRQs */ if (errno == ENOTTY) { fprintf(stderr, "\nNo periodic IRQ support\n"); - return 0; + goto done; } perror("RTC_IRQP_READ ioctl"); exit(errno);
Signature · 1 line
1.4.4.2
PATCH 2/2 rtc-dev: return -ENOTTY in ioctl if irq_set_freq is not implemented by driver
Signed-off-by Hans-Christian Egtvedt <[email protected]>
--- drivers/rtc/rtc-dev.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)
drivers/rtc/rtc-dev.c +2 -0
@@ -306,6 +306,8 @@ static int rtc_dev_ioctl(struct inode *inode, struct file *file,case RTC_IRQP_READ :if (ops->irq_set_freq) err =put_user (rtc->irq_freq, (unsigned long __user *)uarg); +else + err = -ENOTTY ;break ;case RTC_IRQP_SET :
Signature · 1 line
1.4.4.2