aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlessandro Zummo <alessandro.zummo@towertech.it>2006-05-20 18:00:29 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-05-21 15:59:21 -0400
commitb3969e5831adac133b286600e74214e1ae42ec05 (patch)
treed708f1be2b626f0f73ab09a7e6a241640a5dd9fc
parenteae07ac607f317ee6781983d3f9d8f77ef144b45 (diff)
[PATCH] rtc subsystem: use ENOIOCTLCMD and ENOTTY where appropriate
Appropriately use -ENOIOCTLCMD and -ENOTTY when the ioctl is not implemented by a driver. (akpm: we're not allowed to return -ENOIOCTLCMD to userspace. This patch does the right thing). Signed-off-by: Alessandro Zummo <a.zummo@towertech.it> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r--drivers/rtc/rtc-dev.c6
-rw-r--r--drivers/rtc/rtc-sa1100.c2
-rw-r--r--drivers/rtc/rtc-test.c2
-rw-r--r--drivers/rtc/rtc-vr41xx.c2
4 files changed, 6 insertions, 6 deletions
diff --git a/drivers/rtc/rtc-dev.c b/drivers/rtc/rtc-dev.c
index 6c9ad92747fd..2011567005f9 100644
--- a/drivers/rtc/rtc-dev.c
+++ b/drivers/rtc/rtc-dev.c
@@ -141,13 +141,13 @@ static int rtc_dev_ioctl(struct inode *inode, struct file *file,
141 /* try the driver's ioctl interface */ 141 /* try the driver's ioctl interface */
142 if (ops->ioctl) { 142 if (ops->ioctl) {
143 err = ops->ioctl(class_dev->dev, cmd, arg); 143 err = ops->ioctl(class_dev->dev, cmd, arg);
144 if (err != -EINVAL) 144 if (err != -ENOIOCTLCMD)
145 return err; 145 return err;
146 } 146 }
147 147
148 /* if the driver does not provide the ioctl interface 148 /* if the driver does not provide the ioctl interface
149 * or if that particular ioctl was not implemented 149 * or if that particular ioctl was not implemented
150 * (-EINVAL), we will try to emulate here. 150 * (-ENOIOCTLCMD), we will try to emulate here.
151 */ 151 */
152 152
153 switch (cmd) { 153 switch (cmd) {
@@ -233,7 +233,7 @@ static int rtc_dev_ioctl(struct inode *inode, struct file *file,
233 break; 233 break;
234 234
235 default: 235 default:
236 err = -EINVAL; 236 err = -ENOTTY;
237 break; 237 break;
238 } 238 }
239 239
diff --git a/drivers/rtc/rtc-sa1100.c b/drivers/rtc/rtc-sa1100.c
index 2bc8aad47219..a997529f8926 100644
--- a/drivers/rtc/rtc-sa1100.c
+++ b/drivers/rtc/rtc-sa1100.c
@@ -247,7 +247,7 @@ static int sa1100_rtc_ioctl(struct device *dev, unsigned int cmd,
247 rtc_freq = arg; 247 rtc_freq = arg;
248 return 0; 248 return 0;
249 } 249 }
250 return -EINVAL; 250 return -ENOIOCTLCMD;
251} 251}
252 252
253static int sa1100_rtc_read_time(struct device *dev, struct rtc_time *tm) 253static int sa1100_rtc_read_time(struct device *dev, struct rtc_time *tm)
diff --git a/drivers/rtc/rtc-test.c b/drivers/rtc/rtc-test.c
index e1f7e8e86daf..e1fa5fe7901f 100644
--- a/drivers/rtc/rtc-test.c
+++ b/drivers/rtc/rtc-test.c
@@ -71,7 +71,7 @@ static int test_rtc_ioctl(struct device *dev, unsigned int cmd,
71 return 0; 71 return 0;
72 72
73 default: 73 default:
74 return -EINVAL; 74 return -ENOIOCTLCMD;
75 } 75 }
76} 76}
77 77
diff --git a/drivers/rtc/rtc-vr41xx.c b/drivers/rtc/rtc-vr41xx.c
index 4d49fd501198..277596c302e3 100644
--- a/drivers/rtc/rtc-vr41xx.c
+++ b/drivers/rtc/rtc-vr41xx.c
@@ -270,7 +270,7 @@ static int vr41xx_rtc_ioctl(struct device *dev, unsigned int cmd, unsigned long
270 epoch = arg; 270 epoch = arg;
271 break; 271 break;
272 default: 272 default:
273 return -EINVAL; 273 return -ENOIOCTLCMD;
274 } 274 }
275 275
276 return 0; 276 return 0;