]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
[SPARC] sbus rtc: implement ->compat_ioctl
authorChristoph Hellwig <hch@lst.de>
Wed, 9 Nov 2005 20:07:18 +0000 (12:07 -0800)
committerDavid S. Miller <davem@davemloft.net>
Wed, 9 Nov 2005 20:07:18 +0000 (12:07 -0800)
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
arch/sparc64/kernel/ioctl32.c
drivers/sbus/char/rtc.c

index c2e96daa5ab30767ef3915205ed4c8a77d7a8af8..e62214354bb52b0313a1ff0cacba58b8f9e2a5f9 100644 (file)
@@ -114,8 +114,6 @@ COMPATIBLE_IOCTL(FBIOGCURPOS)
 COMPATIBLE_IOCTL(FBIOGCURMAX)
 /* Little k */
 /* Little v, the video4linux ioctls */
-COMPATIBLE_IOCTL(_IOR('p', 20, int[7])) /* RTCGET */
-COMPATIBLE_IOCTL(_IOW('p', 21, int[7])) /* RTCSET */
 /* And these ioctls need translation */
 /* Note SIOCRTMSG is no longer, so this is safe and * the user would have seen just an -EINVAL anyways. */
 HANDLE_IOCTL(FBIOPUTCMAP32, fbiogetputcmap)
index 9b988baf0b5191304ca00ac042851b055f002bd7..5774bdd0e26faaa2e70ba1362978251fac2f19ca 100644 (file)
@@ -210,6 +210,27 @@ static int rtc_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
        }
 }
 
+static long rtc_compat_ioctl(struct file *file, unsigned int cmd,
+       unsigned long arg)
+{
+       int rval = -ENOIOCTLCMD;
+
+       switch (cmd) {
+       /*
+        * These two are specific to this driver, the generic rtc ioctls
+        * are hanlded elsewhere.
+        */
+       case RTCGET:
+       case RTCSET:
+               lock_kernel();
+               rval = rtc_ioctl(file->f_dentry->d_inode, file, cmd, arg);
+               unlock_kernel();
+               break;
+       }
+
+       return rval;
+}
+
 static int rtc_open(struct inode *inode, struct file *file)
 {
        int ret;
@@ -237,6 +258,7 @@ static struct file_operations rtc_fops = {
        .owner =        THIS_MODULE,
        .llseek =       no_llseek,
        .ioctl =        rtc_ioctl,
+       .compat_ioctl = rtc_compat_ioctl,
        .open =         rtc_open,
        .release =      rtc_release,
 };