|
@@ -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;
|
|
|
}
|
|
|
|