summaryrefslogtreecommitdiff
path: root/drivers/rtc/rtc-dev.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2011-02-14 21:10:07 +0300
committerLinus Torvalds <torvalds@linux-foundation.org>2011-02-14 21:10:07 +0300
commitf1b6a4ec27f3c789c15a157590295c501b0a1c58 (patch)
tree52659e15f469d43c381cff1e2928652bca020df0 /drivers/rtc/rtc-dev.c
parent795abaf1e4e188c4171e3cd3dbb11a9fcacaf505 (diff)
parent6ee5859df5baabb82014573d126b9fd790c3a9d8 (diff)
downloadlinux-f1b6a4ec27f3c789c15a157590295c501b0a1c58.tar.xz
Merge branch 'rtc-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
* 'rtc-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: RTC: Fix minor compile warning RTC: Convert rtc drivers to use the alarm_irq_enable method RTC: Fix rtc driver ioctl specific shortcutting
Diffstat (limited to 'drivers/rtc/rtc-dev.c')
-rw-r--r--drivers/rtc/rtc-dev.c21
1 files changed, 7 insertions, 14 deletions
diff --git a/drivers/rtc/rtc-dev.c b/drivers/rtc/rtc-dev.c
index 212b16edafc0..37c3cc1b3dd5 100644
--- a/drivers/rtc/rtc-dev.c
+++ b/drivers/rtc/rtc-dev.c
@@ -154,19 +154,7 @@ static long rtc_dev_ioctl(struct file *file,
if (err)
goto done;
- /* try the driver's ioctl interface */
- if (ops->ioctl) {
- err = ops->ioctl(rtc->dev.parent, cmd, arg);
- if (err != -ENOIOCTLCMD) {
- mutex_unlock(&rtc->ops_lock);
- return err;
- }
- }
-
- /* if the driver does not provide the ioctl interface
- * or if that particular ioctl was not implemented
- * (-ENOIOCTLCMD), we will try to emulate here.
- *
+ /*
* Drivers *SHOULD NOT* provide ioctl implementations
* for these requests. Instead, provide methods to
* support the following code, so that the RTC's main
@@ -329,7 +317,12 @@ static long rtc_dev_ioctl(struct file *file,
return err;
default:
- err = -ENOTTY;
+ /* Finally try the driver's ioctl interface */
+ if (ops->ioctl) {
+ err = ops->ioctl(rtc->dev.parent, cmd, arg);
+ if (err == -ENOIOCTLCMD)
+ err = -ENOTTY;
+ }
break;
}