From b3969e5831adac133b286600e74214e1ae42ec05 Mon Sep 17 00:00:00 2001 From: Alessandro Zummo Date: Sat, 20 May 2006 15:00:29 -0700 Subject: [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 Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/rtc/rtc-dev.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'drivers/rtc/rtc-dev.c') 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, /* try the driver's ioctl interface */ if (ops->ioctl) { err = ops->ioctl(class_dev->dev, cmd, arg); - if (err != -EINVAL) + if (err != -ENOIOCTLCMD) return err; } /* if the driver does not provide the ioctl interface * or if that particular ioctl was not implemented - * (-EINVAL), we will try to emulate here. + * (-ENOIOCTLCMD), we will try to emulate here. */ switch (cmd) { @@ -233,7 +233,7 @@ static int rtc_dev_ioctl(struct inode *inode, struct file *file, break; default: - err = -EINVAL; + err = -ENOTTY; break; } -- cgit v1.2.3