diff options
author | Jesper Nilsson <jesper.nilsson@axis.com> | 2010-07-30 13:04:37 -0400 |
---|---|---|
committer | Jesper Nilsson <jesper.nilsson@axis.com> | 2010-08-04 06:58:57 -0400 |
commit | 90276a1a64e2ab732e26e3ac68febbf3ad04c517 (patch) | |
tree | 423dae23a180e282082e5346705022ad252d1c20 /arch/cris/arch-v10/drivers | |
parent | 3648bdf79f7e020c3a28c9c842111879d8e506c0 (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.c | 30 | ||||
-rw-r--r-- | arch/cris/arch-v10/drivers/i2c.c | 22 | ||||
-rw-r--r-- | arch/cris/arch-v10/drivers/sync_serial.c | 30 |
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"; | |||
46 | static wait_queue_head_t *gpio_wq; | 46 | static wait_queue_head_t *gpio_wq; |
47 | #endif | 47 | #endif |
48 | 48 | ||
49 | static int gpio_ioctl(struct inode *inode, struct file *file, | 49 | static int gpio_ioctl(struct file *file, unsigned int cmd, unsigned long arg); |
50 | unsigned int cmd, unsigned long arg); | ||
51 | static ssize_t gpio_write(struct file *file, const char __user *buf, | 50 | static 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); |
53 | static int gpio_open(struct inode *inode, struct file *filp); | 52 | static int gpio_open(struct inode *inode, struct file *filp); |
@@ -505,8 +504,7 @@ static int | |||
505 | gpio_leds_ioctl(unsigned int cmd, unsigned long arg); | 504 | gpio_leds_ioctl(unsigned int cmd, unsigned long arg); |
506 | 505 | ||
507 | static int | 506 | static int |
508 | gpio_ioctl(struct inode *inode, struct file *file, | 507 | gpio_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 | ||
686 | static int | 684 | static int |
685 | gpio_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 | |||
696 | static int | ||
687 | gpio_leds_ioctl(unsigned int cmd, unsigned long arg) | 697 | gpio_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 | ||
715 | static const struct file_operations gpio_fops = { | 725 | static 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 | ||
724 | static void ioif_watcher(const unsigned int gpio_in_available, | 734 | static 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 | ||
582 | static int | 582 | static int |
583 | i2c_ioctl(struct inode *inode, struct file *file, | 583 | i2c_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 | ||
619 | static 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 | |||
620 | static const struct file_operations i2c_fops = { | 630 | static 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 | ||
627 | int __init | 637 | int __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); | |||
157 | static int sync_serial_release(struct inode *inode, struct file *file); | 157 | static int sync_serial_release(struct inode *inode, struct file *file); |
158 | static unsigned int sync_serial_poll(struct file *filp, poll_table *wait); | 158 | static unsigned int sync_serial_poll(struct file *filp, poll_table *wait); |
159 | 159 | ||
160 | static int sync_serial_ioctl(struct inode *inode, struct file *file, | 160 | static int sync_serial_ioctl(struct file *file, |
161 | unsigned int cmd, unsigned long arg); | 161 | unsigned int cmd, unsigned long arg); |
162 | static ssize_t sync_serial_write(struct file *file, const char *buf, | 162 | static 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 | ||
246 | static const struct file_operations sync_serial_fops = { | 246 | static 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 | ||
256 | static int __init etrax_sync_serial_init(void) | 256 | static 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 | ||
681 | static int sync_serial_ioctl(struct inode *inode, struct file *file, | 681 | static 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 | ||
959 | static 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 | ||
960 | static ssize_t sync_serial_write(struct file *file, const char *buf, | 972 | static 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) |