]> bbs.cooldavid.org Git - net-next-2.6.git/commitdiff
cris: Pushdown the bkl from ioctl
authorJesper Nilsson <jesper.nilsson@axis.com>
Fri, 30 Jul 2010 17:04:37 +0000 (19:04 +0200)
committerJesper Nilsson <jesper.nilsson@axis.com>
Wed, 4 Aug 2010 10:58:57 +0000 (12:58 +0200)
From: Frederic Weisbecker <fweisbec@gmail.com>

Pushdown the bkl to the remaining drivers using the
deprecated .ioctl.

Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Jesper Nilsson <jesper.nilsson@axis.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: John Kacur <jkacur@redhat.com>
arch/cris/arch-v10/drivers/gpio.c
arch/cris/arch-v10/drivers/i2c.c
arch/cris/arch-v10/drivers/sync_serial.c
arch/cris/arch-v32/drivers/cryptocop.c
arch/cris/arch-v32/drivers/mach-a3/gpio.c
arch/cris/arch-v32/drivers/mach-fs/gpio.c
arch/cris/arch-v32/drivers/sync_serial.c

index 4b0f65fac8e8113fde93525f0e754a54035ea327..080927ffe63b8e78b87ea3a4232758fb41cd9600 100644 (file)
@@ -46,8 +46,7 @@ static char gpio_name[] = "etrax gpio";
 static wait_queue_head_t *gpio_wq;
 #endif
 
-static int gpio_ioctl(struct inode *inode, struct file *file,
-       unsigned int cmd, unsigned long arg);
+static int gpio_ioctl(struct file *file, unsigned int cmd, unsigned long arg);
 static ssize_t gpio_write(struct file *file, const char __user *buf,
        size_t count, loff_t *off);
 static int gpio_open(struct inode *inode, struct file *filp);
@@ -505,8 +504,7 @@ static int
 gpio_leds_ioctl(unsigned int cmd, unsigned long arg);
 
 static int
-gpio_ioctl(struct inode *inode, struct file *file,
-          unsigned int cmd, unsigned long arg)
+gpio_ioctl_unlocked(struct file *file, unsigned int cmd, unsigned long arg)
 {
        unsigned long flags;
        unsigned long val;
@@ -683,6 +681,18 @@ gpio_ioctl(struct inode *inode, struct file *file,
        return ret;
 }
 
+static int
+gpio_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
+{
+       long ret;
+
+       lock_kernel();
+       ret = gpio_ioctl_unlocked(file, cmd, arg);
+       unlock_kernel();
+
+       return ret;
+}
+
 static int
 gpio_leds_ioctl(unsigned int cmd, unsigned long arg)
 {
@@ -713,12 +723,12 @@ gpio_leds_ioctl(unsigned int cmd, unsigned long arg)
 }
 
 static const struct file_operations gpio_fops = {
-       .owner       = THIS_MODULE,
-       .poll        = gpio_poll,
-       .ioctl       = gpio_ioctl,
-       .write       = gpio_write,
-       .open        = gpio_open,
-       .release     = gpio_release,
+       .owner          = THIS_MODULE,
+       .poll           = gpio_poll,
+       .unlocked_ioctl = gpio_ioctl,
+       .write          = gpio_write,
+       .open           = gpio_open,
+       .release        = gpio_release,
 };
 
 static void ioif_watcher(const unsigned int gpio_in_available,
index a8737a8eb2294143692a2502d4cef7b9c4a631b3..399e089bed7a4fc953ffcc160967db67965bab5b 100644 (file)
@@ -580,8 +580,7 @@ i2c_release(struct inode *inode, struct file *filp)
  */
 
 static int
-i2c_ioctl(struct inode *inode, struct file *file,
-         unsigned int cmd, unsigned long arg)
+i2c_ioctl_unlocked(struct file *file, unsigned int cmd, unsigned long arg)
 {
        if(_IOC_TYPE(cmd) != ETRAXI2C_IOCTYPE) {
                return -EINVAL;
@@ -617,11 +616,22 @@ i2c_ioctl(struct inode *inode, struct file *file,
        return 0;
 }
 
+static long i2c_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
+{
+       long ret;
+
+       lock_kernel();
+       ret = i2c_ioctl_unlocked(file, cmd, arg);
+       unlock_kernel();
+
+       return ret;
+}
+
 static const struct file_operations i2c_fops = {
-       .owner    = THIS_MODULE,
-       .ioctl    = i2c_ioctl,
-       .open     = i2c_open,
-       .release  = i2c_release,
+       .owner          = THIS_MODULE,
+       .unlocked_ioctl = i2c_ioctl,
+       .open           = i2c_open,
+       .release        = i2c_release,
 };
 
 int __init
index 109dcd826d171cac5d3fcf31228ab7230f057f1a..ee2dd4323daf4ee0c901045748714057c738e64f 100644 (file)
@@ -157,7 +157,7 @@ static int sync_serial_open(struct inode *inode, struct file *file);
 static int sync_serial_release(struct inode *inode, struct file *file);
 static unsigned int sync_serial_poll(struct file *filp, poll_table *wait);
 
-static int sync_serial_ioctl(struct inode *inode, struct file *file,
+static int sync_serial_ioctl(struct file *file,
        unsigned int cmd, unsigned long arg);
 static ssize_t sync_serial_write(struct file *file, const char *buf,
        size_t count, loff_t *ppos);
@@ -244,13 +244,13 @@ static unsigned sync_serial_prescale_shadow;
 #define NUMBER_OF_PORTS 2
 
 static const struct file_operations sync_serial_fops = {
-       .owner   = THIS_MODULE,
-       .write   = sync_serial_write,
-       .read    = sync_serial_read,
-       .poll    = sync_serial_poll,
-       .ioctl   = sync_serial_ioctl,
-       .open    = sync_serial_open,
-       .release = sync_serial_release
+       .owner          = THIS_MODULE,
+       .write          = sync_serial_write,
+       .read           = sync_serial_read,
+       .poll           = sync_serial_poll,
+       .unlocked_ioctl = sync_serial_ioctl,
+       .open           = sync_serial_open,
+       .release        = sync_serial_release
 };
 
 static int __init etrax_sync_serial_init(void)
@@ -678,7 +678,7 @@ static unsigned int sync_serial_poll(struct file *file, poll_table *wait)
        return mask;
 }
 
-static int sync_serial_ioctl(struct inode *inode, struct file *file,
+static int sync_serial_ioctl_unlocked(struct file *file,
                  unsigned int cmd, unsigned long arg)
 {
        int return_val = 0;
@@ -956,6 +956,18 @@ static int sync_serial_ioctl(struct inode *inode, struct file *file,
        return return_val;
 }
 
+static long sync_serial_ioctl(struct file *file,
+                             unsigned int cmd, unsigned long arg)
+{
+       long ret;
+
+       lock_kernel();
+       ret = sync_serial_ioctl_unlocked(file, cmd, arg);
+       unlock_kernel();
+
+       return ret;
+}
+
 
 static ssize_t sync_serial_write(struct file *file, const char *buf,
        size_t count, loff_t *ppos)
index b70fb34939d97b68859f2fadbf042253ec70d659..9cfbfae107c770bf216e366e2dba3d15fd914c6a 100644 (file)
@@ -217,7 +217,7 @@ static int cryptocop_open(struct inode *, struct file *);
 
 static int cryptocop_release(struct inode *, struct file *);
 
-static int cryptocop_ioctl(struct inode *inode, struct file *file,
+static long cryptocop_ioctl(struct file *file,
                           unsigned int cmd, unsigned long arg);
 
 static void cryptocop_start_job(void);
@@ -279,10 +279,10 @@ static void print_user_dma_lists(struct cryptocop_dma_list_operation *dma_op);
 
 
 const struct file_operations cryptocop_fops = {
-       .owner =        THIS_MODULE,
-       .open =         cryptocop_open,
-       .release =      cryptocop_release,
-       .ioctl =        cryptocop_ioctl
+       .owner          = THIS_MODULE,
+       .open           = cryptocop_open,
+       .release        = cryptocop_release,
+       .unlocked_ioctl = cryptocop_ioctl
 };
 
 
@@ -3102,7 +3102,8 @@ static int cryptocop_ioctl_create_session(struct inode *inode, struct file *filp
        return 0;
 }
 
-static int cryptocop_ioctl(struct inode *inode, struct file *filp, unsigned int cmd, unsigned long arg)
+static long cryptocop_ioctl_unlocked(struct inode *inode,
+       struct file *filp, unsigned int cmd, unsigned long arg)
 {
        int err = 0;
        if (_IOC_TYPE(cmd) != ETRAXCRYPTOCOP_IOCTYPE) {
@@ -3134,6 +3135,19 @@ static int cryptocop_ioctl(struct inode *inode, struct file *filp, unsigned int
        return 0;
 }
 
+static long
+cryptocop_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
+{
+       struct inode *inode = file->f_path.dentry->d_inode;
+       long ret;
+
+       lock_kernel();
+       ret = cryptocop_ioctl_unlocked(inode, filp, cmd, arg);
+       unlock_kernel();
+
+       return ret;
+}
+
 
 #ifdef LDEBUG
 static void print_dma_descriptors(struct cryptocop_int_operation *iop)
index 97357cfd17bbc90a0f72da1f732d00c47af67079..2dcd27adbad485442f55278119b51e298ddf0687 100644 (file)
@@ -72,8 +72,7 @@ static char gpio_name[] = "etrax gpio";
 static int virtual_gpio_ioctl(struct file *file, unsigned int cmd,
                              unsigned long arg);
 #endif
-static int gpio_ioctl(struct inode *inode, struct file *file,
-       unsigned int cmd, unsigned long arg);
+static long gpio_ioctl(struct file *file, unsigned int cmd, unsigned long arg);
 static ssize_t gpio_write(struct file *file, const char __user *buf,
        size_t count, loff_t *off);
 static int gpio_open(struct inode *inode, struct file *filp);
@@ -521,7 +520,7 @@ static inline unsigned long setget_output(struct gpio_private *priv,
        return dir_shadow;
 } /* setget_output */
 
-static int gpio_ioctl(struct inode *inode, struct file *file,
+static long gpio_ioctl_unlocked(struct file *file,
        unsigned int cmd, unsigned long arg)
 {
        unsigned long flags;
@@ -664,6 +663,17 @@ static int gpio_ioctl(struct inode *inode, struct file *file,
        return 0;
 }
 
+static long gpio_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
+{
+       long ret;
+
+       lock_kernel();
+       ret = gpio_ioctl_unlocked(file, cmd, arg);
+       unlock_kernel();
+
+       return ret;
+}
+
 #ifdef CONFIG_ETRAX_VIRTUAL_GPIO
 static int virtual_gpio_ioctl(struct file *file, unsigned int cmd,
        unsigned long arg)
@@ -877,12 +887,12 @@ static int gpio_pwm_ioctl(struct gpio_private *priv, unsigned int cmd,
 }
 
 static const struct file_operations gpio_fops = {
-       .owner       = THIS_MODULE,
-       .poll        = gpio_poll,
-       .ioctl       = gpio_ioctl,
-       .write       = gpio_write,
-       .open        = gpio_open,
-       .release     = gpio_release,
+       .owner          = THIS_MODULE,
+       .poll           = gpio_poll,
+       .unlocked_ioctl = gpio_ioctl,
+       .write          = gpio_write,
+       .open           = gpio_open,
+       .release        = gpio_release,
 };
 
 #ifdef CONFIG_ETRAX_VIRTUAL_GPIO
index d89ab80498edcafa6327bd74d6b0f404f54e5d32..3a12ce309e3b6a0de4e202681fff686434ebfb34 100644 (file)
@@ -74,8 +74,7 @@ static wait_queue_head_t *gpio_wq;
 static int virtual_gpio_ioctl(struct file *file, unsigned int cmd,
        unsigned long arg);
 #endif
-static int gpio_ioctl(struct inode *inode, struct file *file,
-       unsigned int cmd, unsigned long arg);
+static long gpio_ioctl(struct file *file, unsigned int cmd, unsigned long arg);
 static ssize_t gpio_write(struct file *file, const char *buf, size_t count,
        loff_t *off);
 static int gpio_open(struct inode *inode, struct file *filp);
@@ -557,12 +556,10 @@ inline unsigned long setget_output(struct gpio_private *priv, unsigned long arg)
        return dir_shadow;
 } /* setget_output */
 
-static int
-gpio_leds_ioctl(unsigned int cmd, unsigned long arg);
+static int gpio_leds_ioctl(unsigned int cmd, unsigned long arg);
 
 static int
-gpio_ioctl(struct inode *inode, struct file *file,
-          unsigned int cmd, unsigned long arg)
+gpio_ioctl_unlocked(struct file *file, unsigned int cmd, unsigned long arg)
 {
        unsigned long flags;
        unsigned long val;
@@ -707,6 +704,17 @@ gpio_ioctl(struct inode *inode, struct file *file,
        return 0;
 }
 
+static long gpio_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
+{
+       long ret;
+
+       lock_kernel();
+       ret = gpio_ioctl_unlocked(file, cmd, arg);
+       unlock_kernel();
+
+       return ret;
+}
+
 #ifdef CONFIG_ETRAX_VIRTUAL_GPIO
 static int
 virtual_gpio_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
@@ -856,12 +864,12 @@ gpio_leds_ioctl(unsigned int cmd, unsigned long arg)
 }
 
 static const struct file_operations gpio_fops = {
-       .owner       = THIS_MODULE,
-       .poll        = gpio_poll,
-       .ioctl       = gpio_ioctl,
-       .write       = gpio_write,
-       .open        = gpio_open,
-       .release     = gpio_release,
+       .owner          = THIS_MODULE,
+       .poll           = gpio_poll,
+       .unlocked_ioctl = gpio_ioctl,
+       .write          = gpio_write,
+       .open           = gpio_open,
+       .release        = gpio_release,
 };
 
 #ifdef CONFIG_ETRAX_VIRTUAL_GPIO
index 4889f196ecd6c2478c11b309c4fc06ca89ebf0c0..ca248f3adb800e26403d591b9c72c8cae0c200fa 100644 (file)
@@ -153,7 +153,7 @@ static int sync_serial_open(struct inode *, struct file*);
 static int sync_serial_release(struct inode*, struct file*);
 static unsigned int sync_serial_poll(struct file *filp, poll_table *wait);
 
-static int sync_serial_ioctl(struct inode*, struct file*,
+static int sync_serial_ioctl(struct file *,
                             unsigned int cmd, unsigned long arg);
 static ssize_t sync_serial_write(struct file * file, const char * buf,
                                 size_t count, loff_t *ppos);
@@ -241,13 +241,13 @@ static struct sync_port ports[]=
 #define NBR_PORTS ARRAY_SIZE(ports)
 
 static const struct file_operations sync_serial_fops = {
-       .owner   = THIS_MODULE,
-       .write   = sync_serial_write,
-       .read    = sync_serial_read,
-       .poll    = sync_serial_poll,
-       .ioctl   = sync_serial_ioctl,
-       .open    = sync_serial_open,
-       .release = sync_serial_release
+       .owner          = THIS_MODULE,
+       .write          = sync_serial_write,
+       .read           = sync_serial_read,
+       .poll           = sync_serial_poll,
+       .unlocked_ioctl = sync_serial_ioctl,
+       .open           = sync_serial_open,
+       .release        = sync_serial_release
 };
 
 static int __init etrax_sync_serial_init(void)
@@ -650,7 +650,7 @@ static unsigned int sync_serial_poll(struct file *file, poll_table *wait)
        return mask;
 }
 
-static int sync_serial_ioctl(struct inode *inode, struct file *file,
+static int sync_serial_ioctl(struct file *file,
                  unsigned int cmd, unsigned long arg)
 {
        int return_val = 0;
@@ -961,6 +961,18 @@ static int sync_serial_ioctl(struct inode *inode, struct file *file,
        return return_val;
 }
 
+static long sync_serial_ioctl(struct file *file,
+                             unsigned int cmd, unsigned long arg)
+{
+       long ret;
+
+       lock_kernel();
+       ret = sync_serial_ioctl_unlocked(file, cmd, arg);
+       unlock_kernel();
+
+       return ret;
+}
+
 /* NOTE: sync_serial_write does not support concurrency */
 static ssize_t sync_serial_write(struct file *file, const char *buf,
                                 size_t count, loff_t *ppos)