+ rtc-subsystem-use-enoioctlcmd-and-enotty-where-appropriate.patch added to -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled

     rtc subsystem: use ENOIOCTLCMD and ENOTTY where appropriate

has been added to the -mm tree.  Its filename is

     rtc-subsystem-use-enoioctlcmd-and-enotty-where-appropriate.patch

See http://www.zip.com.au/~akpm/linux/patches/stuff/added-to-mm.txt to find
out what to do about this

------------------------------------------------------
Subject: rtc subsystem: use ENOIOCTLCMD and ENOTTY where appropriate
From: Alessandro Zummo <alessandro.zummo@xxxxxxxxxxxx>


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@xxxxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxx>
---

 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(-)

diff -puN drivers/rtc/rtc-dev.c~rtc-subsystem-use-enoioctlcmd-and-enotty-where-appropriate drivers/rtc/rtc-dev.c
--- 25/drivers/rtc/rtc-dev.c~rtc-subsystem-use-enoioctlcmd-and-enotty-where-appropriate	Fri May 19 13:29:25 2006
+++ 25-akpm/drivers/rtc/rtc-dev.c	Fri May 19 13:29:25 2006
@@ -245,13 +245,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) {
@@ -338,7 +338,7 @@ static int rtc_dev_ioctl(struct inode *i
 		return set_uie(rtc);
 #endif
 	default:
-		err = -EINVAL;
+		err = -ENOTTY;
 		break;
 	}
 
diff -puN drivers/rtc/rtc-sa1100.c~rtc-subsystem-use-enoioctlcmd-and-enotty-where-appropriate drivers/rtc/rtc-sa1100.c
--- 25/drivers/rtc/rtc-sa1100.c~rtc-subsystem-use-enoioctlcmd-and-enotty-where-appropriate	Fri May 19 13:29:25 2006
+++ 25-akpm/drivers/rtc/rtc-sa1100.c	Fri May 19 13:29:25 2006
@@ -243,7 +243,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)
diff -puN drivers/rtc/rtc-test.c~rtc-subsystem-use-enoioctlcmd-and-enotty-where-appropriate drivers/rtc/rtc-test.c
--- 25/drivers/rtc/rtc-test.c~rtc-subsystem-use-enoioctlcmd-and-enotty-where-appropriate	Fri May 19 13:29:25 2006
+++ 25-akpm/drivers/rtc/rtc-test.c	Fri May 19 13:29:25 2006
@@ -71,7 +71,7 @@ static int test_rtc_ioctl(struct device 
 		return 0;
 
 	default:
-		return -EINVAL;
+		return -ENOIOCTLCMD;
 	}
 }
 
diff -puN drivers/rtc/rtc-vr41xx.c~rtc-subsystem-use-enoioctlcmd-and-enotty-where-appropriate drivers/rtc/rtc-vr41xx.c
--- 25/drivers/rtc/rtc-vr41xx.c~rtc-subsystem-use-enoioctlcmd-and-enotty-where-appropriate	Fri May 19 13:29:25 2006
+++ 25-akpm/drivers/rtc/rtc-vr41xx.c	Fri May 19 13:29:25 2006
@@ -262,7 +262,7 @@ static int vr41xx_rtc_ioctl(struct devic
 		epoch = arg;
 		break;
 	default:
-		return -EINVAL;
+		return -ENOIOCTLCMD;
 	}
 
 	return 0;
_

Patches currently in -mm which might be from alessandro.zummo@xxxxxxxxxxxx are

rtc-subsystem-use-enoioctlcmd-and-enotty-where-appropriate.patch
rtc-subsystem-fix-capability-checks-in-kernel-interface.patch
rtc-subsystem-add-capability-checks.patch

-
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Kernel Newbies FAQ]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Photo]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux