diff options
author | John Stultz <john.stultz@linaro.org> | 2011-06-01 02:26:11 -0400 |
---|---|---|
committer | John Stultz <john.stultz@linaro.org> | 2011-06-01 22:29:39 -0400 |
commit | e17fd4ba2a81f1d29875b20464e4899185a3c946 (patch) | |
tree | d725e39d38d1cba1831297048ec54f79cb99ebca /drivers/rtc/rtc-dev.c | |
parent | 1fa7b6a29c61358cc2ca6f64cef4aa0e1a7ca74c (diff) |
rtc: Fix ioctl error path return
Bryan Henderson noticed that the "RTC: Fix rtc driver ioctl specific
shortcutting" commit has a small bug: When an ioctl is called with an
invalid command code and the clock driver does not have an "ioctl"
method, the ioctl returns rc 0 instead of -ENOTTY.
This patch fixes the issue.
CC: Bryan Henderson <bryanh@giraffe-data.com>
CC: Gabor Z. Papp <gzp@papp.hu>
Reported-by: Bryan Henderson <bryanh@giraffe-data.com>
Signed-off-by: John Stultz <john.stultz@linaro.org>
Diffstat (limited to 'drivers/rtc/rtc-dev.c')
-rw-r--r-- | drivers/rtc/rtc-dev.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/rtc/rtc-dev.c b/drivers/rtc/rtc-dev.c index d0e06edb14c5..cace6d3aed9a 100644 --- a/drivers/rtc/rtc-dev.c +++ b/drivers/rtc/rtc-dev.c | |||
@@ -421,7 +421,8 @@ static long rtc_dev_ioctl(struct file *file, | |||
421 | err = ops->ioctl(rtc->dev.parent, cmd, arg); | 421 | err = ops->ioctl(rtc->dev.parent, cmd, arg); |
422 | if (err == -ENOIOCTLCMD) | 422 | if (err == -ENOIOCTLCMD) |
423 | err = -ENOTTY; | 423 | err = -ENOTTY; |
424 | } | 424 | } else |
425 | err = -ENOTTY; | ||
425 | break; | 426 | break; |
426 | } | 427 | } |
427 | 428 | ||