aboutsummaryrefslogtreecommitdiffstats
path: root/arch/cris/arch-v10/drivers
diff options
context:
space:
mode:
authorJesper Nilsson <jesper.nilsson@axis.com>2010-07-30 13:04:37 -0400
committerJesper Nilsson <jesper.nilsson@axis.com>2010-08-04 06:58:57 -0400
commit90276a1a64e2ab732e26e3ac68febbf3ad04c517 (patch)
tree423dae23a180e282082e5346705022ad252d1c20 /arch/cris/arch-v10/drivers
parent3648bdf79f7e020c3a28c9c842111879d8e506c0 (diff)
cris: Pushdown the bkl from ioctl
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>
Diffstat (limited to 'arch/cris/arch-v10/drivers')
-rw-r--r--arch/cris/arch-v10/drivers/gpio.c30
-rw-r--r--arch/cris/arch-v10/drivers/i2c.c22
-rw-r--r--arch/cris/arch-v10/drivers/sync_serial.c30
3 files changed, 57 insertions, 25 deletions
diff --git a/arch/cris/arch-v10/drivers/gpio.c b/arch/cris/arch-v10/drivers/gpio.c
index 4b0f65fac8e8..080927ffe63b 100644
--- a/arch/cris/arch-v10/drivers/gpio.c
+++ b/arch/cris/arch-v10/drivers/gpio.c
@@ -46,8 +46,7 @@ static char gpio_name[] = "etrax gpio";
46static wait_queue_head_t *gpio_wq; 46static wait_queue_head_t *gpio_wq;
47#endif 47#endif
48 48
49static int gpio_ioctl(struct inode *inode, struct file *file, 49static int gpio_ioctl(struct file *file, unsigned int cmd, unsigned long arg);
50 unsigned int cmd, unsigned long arg);
51static ssize_t gpio_write(struct file *file, const char __user *buf, 50static ssize_t gpio_write(struct file *file, const char __user *buf,
52 size_t count, loff_t *off); 51 size_t count, loff_t *off);
53static int gpio_open(struct inode *inode, struct file *filp); 52static int gpio_open(struct inode *inode, struct file *filp);
@@ -505,8 +504,7 @@ static int
505gpio_leds_ioctl(unsigned int cmd, unsigned long arg); 504gpio_leds_ioctl(unsigned int cmd, unsigned long arg);
506 505
507static int 506static int
508gpio_ioctl(struct inode *inode, struct file *file, 507gpio_ioctl_unlocked(struct file *file, unsigned int cmd, unsigned long arg)
509 unsigned int cmd, unsigned long arg)
510{ 508{
511 unsigned long flags; 509 unsigned long flags;
512 unsigned long val; 510 unsigned long val;
@@ -684,6 +682,18 @@ gpio_ioctl(struct inode *inode, struct file *file,
684} 682}
685 683
686static int 684static int
685gpio_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
686{
687 long ret;
688
689 lock_kernel();
690 ret = gpio_ioctl_unlocked(file, cmd, arg);
691 unlock_kernel();
692
693 return ret;
694}
695
696static int
687gpio_leds_ioctl(unsigned int cmd, unsigned long arg) 697gpio_leds_ioctl(unsigned int cmd, unsigned long arg)
688{ 698{
689 unsigned char green; 699 unsigned char green;
@@ -713,12 +723,12 @@ gpio_leds_ioctl(unsigned int cmd, unsigned long arg)
713} 723}
714 724
715static const struct file_operations gpio_fops = { 725static const struct file_operations gpio_fops = {
716 .owner = THIS_MODULE, 726 .owner = THIS_MODULE,
717 .poll = gpio_poll, 727 .poll = gpio_poll,
718 .ioctl = gpio_ioctl, 728 .unlocked_ioctl = gpio_ioctl,
719 .write = gpio_write, 729 .write = gpio_write,
720 .open = gpio_open, 730 .open = gpio_open,
721 .release = gpio_release, 731 .release = gpio_release,
722}; 732};
723 733
724static void ioif_watcher(const unsigned int gpio_in_available, 734static void ioif_watcher(const unsigned int gpio_in_available,
diff --git a/arch/cris/arch-v10/drivers/i2c.c b/arch/cris/arch-v10/drivers/i2c.c
index a8737a8eb229..399e089bed7a 100644
--- a/arch/cris/arch-v10/drivers/i2c.c
+++ b/arch/cris/arch-v10/drivers/i2c.c
@@ -580,8 +580,7 @@ i2c_release(struct inode *inode, struct file *filp)
580 */ 580 */
581 581
582static int 582static int
583i2c_ioctl(struct inode *inode, struct file *file, 583i2c_ioctl_unlocked(struct file *file, unsigned int cmd, unsigned long arg)
584 unsigned int cmd, unsigned long arg)
585{ 584{
586 if(_IOC_TYPE(cmd) != ETRAXI2C_IOCTYPE) { 585 if(_IOC_TYPE(cmd) != ETRAXI2C_IOCTYPE) {
587 return -EINVAL; 586 return -EINVAL;
@@ -617,11 +616,22 @@ i2c_ioctl(struct inode *inode, struct file *file,
617 return 0; 616 return 0;
618} 617}
619 618
619static long i2c_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
620{
621 long ret;
622
623 lock_kernel();
624 ret = i2c_ioctl_unlocked(file, cmd, arg);
625 unlock_kernel();
626
627 return ret;
628}
629
620static const struct file_operations i2c_fops = { 630static const struct file_operations i2c_fops = {
621 .owner = THIS_MODULE, 631 .owner = THIS_MODULE,
622 .ioctl = i2c_ioctl, 632 .unlocked_ioctl = i2c_ioctl,
623 .open = i2c_open, 633 .open = i2c_open,
624 .release = i2c_release, 634 .release = i2c_release,
625}; 635};
626 636
627int __init 637int __init
diff --git a/arch/cris/arch-v10/drivers/sync_serial.c b/arch/cris/arch-v10/drivers/sync_serial.c
index 109dcd826d17..ee2dd4323daf 100644
--- a/arch/cris/arch-v10/drivers/sync_serial.c
+++ b/arch/cris/arch-v10/drivers/sync_serial.c
@@ -157,7 +157,7 @@ static int sync_serial_open(struct inode *inode, struct file *file);
157static int sync_serial_release(struct inode *inode, struct file *file); 157static int sync_serial_release(struct inode *inode, struct file *file);
158static unsigned int sync_serial_poll(struct file *filp, poll_table *wait); 158static unsigned int sync_serial_poll(struct file *filp, poll_table *wait);
159 159
160static int sync_serial_ioctl(struct inode *inode, struct file *file, 160static int sync_serial_ioctl(struct file *file,
161 unsigned int cmd, unsigned long arg); 161 unsigned int cmd, unsigned long arg);
162static ssize_t sync_serial_write(struct file *file, const char *buf, 162static ssize_t sync_serial_write(struct file *file, const char *buf,
163 size_t count, loff_t *ppos); 163 size_t count, loff_t *ppos);
@@ -244,13 +244,13 @@ static unsigned sync_serial_prescale_shadow;
244#define NUMBER_OF_PORTS 2 244#define NUMBER_OF_PORTS 2
245 245
246static const struct file_operations sync_serial_fops = { 246static const struct file_operations sync_serial_fops = {
247 .owner = THIS_MODULE, 247 .owner = THIS_MODULE,
248 .write = sync_serial_write, 248 .write = sync_serial_write,
249 .read = sync_serial_read, 249 .read = sync_serial_read,
250 .poll = sync_serial_poll, 250 .poll = sync_serial_poll,
251 .ioctl = sync_serial_ioctl, 251 .unlocked_ioctl = sync_serial_ioctl,
252 .open = sync_serial_open, 252 .open = sync_serial_open,
253 .release = sync_serial_release 253 .release = sync_serial_release
254}; 254};
255 255
256static int __init etrax_sync_serial_init(void) 256static int __init etrax_sync_serial_init(void)
@@ -678,7 +678,7 @@ static unsigned int sync_serial_poll(struct file *file, poll_table *wait)
678 return mask; 678 return mask;
679} 679}
680 680
681static int sync_serial_ioctl(struct inode *inode, struct file *file, 681static int sync_serial_ioctl_unlocked(struct file *file,
682 unsigned int cmd, unsigned long arg) 682 unsigned int cmd, unsigned long arg)
683{ 683{
684 int return_val = 0; 684 int return_val = 0;
@@ -956,6 +956,18 @@ static int sync_serial_ioctl(struct inode *inode, struct file *file,
956 return return_val; 956 return return_val;
957} 957}
958 958
959static long sync_serial_ioctl(struct file *file,
960 unsigned int cmd, unsigned long arg)
961{
962 long ret;
963
964 lock_kernel();
965 ret = sync_serial_ioctl_unlocked(file, cmd, arg);
966 unlock_kernel();
967
968 return ret;
969}
970
959 971
960static ssize_t sync_serial_write(struct file *file, const char *buf, 972static ssize_t sync_serial_write(struct file *file, const char *buf,
961 size_t count, loff_t *ppos) 973 size_t count, loff_t *ppos)