Skip to contentSkip to conversation

rtc subsystem, use ENOIOCTLCMD and ENOTTY where appropriate

PATCH New Alessandro Zummo 1 participant 1 message May 19, 2006 Real time clock (RTC)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 rtc subsystem, use ENOIOCTLCMD and ENOTTY where appropriate

Appropriately use -ENOIOCTLCMD and -ENOTTY when
the ioctl is not implemented by a driver.

---
 drivers/rtc/rtc-dev.c    |    6 +++---
 drivers/rtc/rtc-sa1100.c |    2 +-
 drivers/rtc/rtc-test.c   |    2 +-
 drivers/rtc/rtc-vr41xx.c |    2 +-
 4 files changed, 6 insertions(+), 6 deletions(-)
drivers/rtc/rtc-test.c +1 -1
@@ -71,7 +71,7 @@ static int test_rtc_ioctl(struct device 
 		return 0;
 
 	default:
-		return -EINVAL;
+		return -ENOIOCTLCMD;
 	}
 }
 
drivers/rtc/rtc-vr41xx.c +1 -1
@@ -270,7 +270,7 @@ static int vr41xx_rtc_ioctl(struct devic
 		epoch = arg;
 		break;
 	default:
-		return -EINVAL;
+		return -ENOIOCTLCMD;
 	}
 
 	return 0;
drivers/rtc/rtc-sa1100.c +1 -1
@@ -247,7 +247,7 @@ static int sa1100_rtc_ioctl(struct devic
 		rtc_freq = arg;
 		return 0;
 	}
-	return -EINVAL;
+	return -ENOIOCTLCMD;
 }
 
 static int sa1100_rtc_read_time(struct device *dev, struct rtc_time *tm)
drivers/rtc/rtc-dev.c +3 -3
@@ -141,13 +141,13 @@ static int rtc_dev_ioctl(struct inode *i
 	/* 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 *i
 		break;
 
 	default:
-		err = -EINVAL;
+		err = -ENOTTY;
 		break;
 	}