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 | |
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>
-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 | ||||
-rw-r--r-- | arch/cris/arch-v32/drivers/cryptocop.c | 26 | ||||
-rw-r--r-- | arch/cris/arch-v32/drivers/mach-a3/gpio.c | 28 | ||||
-rw-r--r-- | arch/cris/arch-v32/drivers/mach-fs/gpio.c | 32 | ||||
-rw-r--r-- | arch/cris/arch-v32/drivers/sync_serial.c | 30 |
7 files changed, 137 insertions, 61 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) |
diff --git a/arch/cris/arch-v32/drivers/cryptocop.c b/arch/cris/arch-v32/drivers/cryptocop.c index b70fb34939d9..9cfbfae107c7 100644 --- a/arch/cris/arch-v32/drivers/cryptocop.c +++ b/arch/cris/arch-v32/drivers/cryptocop.c | |||
@@ -217,7 +217,7 @@ static int cryptocop_open(struct inode *, struct file *); | |||
217 | 217 | ||
218 | static int cryptocop_release(struct inode *, struct file *); | 218 | static int cryptocop_release(struct inode *, struct file *); |
219 | 219 | ||
220 | static int cryptocop_ioctl(struct inode *inode, struct file *file, | 220 | static long cryptocop_ioctl(struct file *file, |
221 | unsigned int cmd, unsigned long arg); | 221 | unsigned int cmd, unsigned long arg); |
222 | 222 | ||
223 | static void cryptocop_start_job(void); | 223 | static void cryptocop_start_job(void); |
@@ -279,10 +279,10 @@ static void print_user_dma_lists(struct cryptocop_dma_list_operation *dma_op); | |||
279 | 279 | ||
280 | 280 | ||
281 | const struct file_operations cryptocop_fops = { | 281 | const struct file_operations cryptocop_fops = { |
282 | .owner = THIS_MODULE, | 282 | .owner = THIS_MODULE, |
283 | .open = cryptocop_open, | 283 | .open = cryptocop_open, |
284 | .release = cryptocop_release, | 284 | .release = cryptocop_release, |
285 | .ioctl = cryptocop_ioctl | 285 | .unlocked_ioctl = cryptocop_ioctl |
286 | }; | 286 | }; |
287 | 287 | ||
288 | 288 | ||
@@ -3102,7 +3102,8 @@ static int cryptocop_ioctl_create_session(struct inode *inode, struct file *filp | |||
3102 | return 0; | 3102 | return 0; |
3103 | } | 3103 | } |
3104 | 3104 | ||
3105 | static int cryptocop_ioctl(struct inode *inode, struct file *filp, unsigned int cmd, unsigned long arg) | 3105 | static long cryptocop_ioctl_unlocked(struct inode *inode, |
3106 | struct file *filp, unsigned int cmd, unsigned long arg) | ||
3106 | { | 3107 | { |
3107 | int err = 0; | 3108 | int err = 0; |
3108 | if (_IOC_TYPE(cmd) != ETRAXCRYPTOCOP_IOCTYPE) { | 3109 | if (_IOC_TYPE(cmd) != ETRAXCRYPTOCOP_IOCTYPE) { |
@@ -3134,6 +3135,19 @@ static int cryptocop_ioctl(struct inode *inode, struct file *filp, unsigned int | |||
3134 | return 0; | 3135 | return 0; |
3135 | } | 3136 | } |
3136 | 3137 | ||
3138 | static long | ||
3139 | cryptocop_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) | ||
3140 | { | ||
3141 | struct inode *inode = file->f_path.dentry->d_inode; | ||
3142 | long ret; | ||
3143 | |||
3144 | lock_kernel(); | ||
3145 | ret = cryptocop_ioctl_unlocked(inode, filp, cmd, arg); | ||
3146 | unlock_kernel(); | ||
3147 | |||
3148 | return ret; | ||
3149 | } | ||
3150 | |||
3137 | 3151 | ||
3138 | #ifdef LDEBUG | 3152 | #ifdef LDEBUG |
3139 | static void print_dma_descriptors(struct cryptocop_int_operation *iop) | 3153 | static void print_dma_descriptors(struct cryptocop_int_operation *iop) |
diff --git a/arch/cris/arch-v32/drivers/mach-a3/gpio.c b/arch/cris/arch-v32/drivers/mach-a3/gpio.c index 97357cfd17bb..2dcd27adbad4 100644 --- a/arch/cris/arch-v32/drivers/mach-a3/gpio.c +++ b/arch/cris/arch-v32/drivers/mach-a3/gpio.c | |||
@@ -72,8 +72,7 @@ static char gpio_name[] = "etrax gpio"; | |||
72 | static int virtual_gpio_ioctl(struct file *file, unsigned int cmd, | 72 | static int virtual_gpio_ioctl(struct file *file, unsigned int cmd, |
73 | unsigned long arg); | 73 | unsigned long arg); |
74 | #endif | 74 | #endif |
75 | static int gpio_ioctl(struct inode *inode, struct file *file, | 75 | static long gpio_ioctl(struct file *file, unsigned int cmd, unsigned long arg); |
76 | unsigned int cmd, unsigned long arg); | ||
77 | static ssize_t gpio_write(struct file *file, const char __user *buf, | 76 | static ssize_t gpio_write(struct file *file, const char __user *buf, |
78 | size_t count, loff_t *off); | 77 | size_t count, loff_t *off); |
79 | static int gpio_open(struct inode *inode, struct file *filp); | 78 | static int gpio_open(struct inode *inode, struct file *filp); |
@@ -521,7 +520,7 @@ static inline unsigned long setget_output(struct gpio_private *priv, | |||
521 | return dir_shadow; | 520 | return dir_shadow; |
522 | } /* setget_output */ | 521 | } /* setget_output */ |
523 | 522 | ||
524 | static int gpio_ioctl(struct inode *inode, struct file *file, | 523 | static long gpio_ioctl_unlocked(struct file *file, |
525 | unsigned int cmd, unsigned long arg) | 524 | unsigned int cmd, unsigned long arg) |
526 | { | 525 | { |
527 | unsigned long flags; | 526 | unsigned long flags; |
@@ -664,6 +663,17 @@ static int gpio_ioctl(struct inode *inode, struct file *file, | |||
664 | return 0; | 663 | return 0; |
665 | } | 664 | } |
666 | 665 | ||
666 | static long gpio_ioctl(struct file *file, unsigned int cmd, unsigned long arg) | ||
667 | { | ||
668 | long ret; | ||
669 | |||
670 | lock_kernel(); | ||
671 | ret = gpio_ioctl_unlocked(file, cmd, arg); | ||
672 | unlock_kernel(); | ||
673 | |||
674 | return ret; | ||
675 | } | ||
676 | |||
667 | #ifdef CONFIG_ETRAX_VIRTUAL_GPIO | 677 | #ifdef CONFIG_ETRAX_VIRTUAL_GPIO |
668 | static int virtual_gpio_ioctl(struct file *file, unsigned int cmd, | 678 | static int virtual_gpio_ioctl(struct file *file, unsigned int cmd, |
669 | unsigned long arg) | 679 | unsigned long arg) |
@@ -877,12 +887,12 @@ static int gpio_pwm_ioctl(struct gpio_private *priv, unsigned int cmd, | |||
877 | } | 887 | } |
878 | 888 | ||
879 | static const struct file_operations gpio_fops = { | 889 | static const struct file_operations gpio_fops = { |
880 | .owner = THIS_MODULE, | 890 | .owner = THIS_MODULE, |
881 | .poll = gpio_poll, | 891 | .poll = gpio_poll, |
882 | .ioctl = gpio_ioctl, | 892 | .unlocked_ioctl = gpio_ioctl, |
883 | .write = gpio_write, | 893 | .write = gpio_write, |
884 | .open = gpio_open, | 894 | .open = gpio_open, |
885 | .release = gpio_release, | 895 | .release = gpio_release, |
886 | }; | 896 | }; |
887 | 897 | ||
888 | #ifdef CONFIG_ETRAX_VIRTUAL_GPIO | 898 | #ifdef CONFIG_ETRAX_VIRTUAL_GPIO |
diff --git a/arch/cris/arch-v32/drivers/mach-fs/gpio.c b/arch/cris/arch-v32/drivers/mach-fs/gpio.c index d89ab80498ed..3a12ce309e3b 100644 --- a/arch/cris/arch-v32/drivers/mach-fs/gpio.c +++ b/arch/cris/arch-v32/drivers/mach-fs/gpio.c | |||
@@ -74,8 +74,7 @@ static wait_queue_head_t *gpio_wq; | |||
74 | static int virtual_gpio_ioctl(struct file *file, unsigned int cmd, | 74 | static int virtual_gpio_ioctl(struct file *file, unsigned int cmd, |
75 | unsigned long arg); | 75 | unsigned long arg); |
76 | #endif | 76 | #endif |
77 | static int gpio_ioctl(struct inode *inode, struct file *file, | 77 | static long gpio_ioctl(struct file *file, unsigned int cmd, unsigned long arg); |
78 | unsigned int cmd, unsigned long arg); | ||
79 | static ssize_t gpio_write(struct file *file, const char *buf, size_t count, | 78 | static ssize_t gpio_write(struct file *file, const char *buf, size_t count, |
80 | loff_t *off); | 79 | loff_t *off); |
81 | static int gpio_open(struct inode *inode, struct file *filp); | 80 | 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) | |||
557 | return dir_shadow; | 556 | return dir_shadow; |
558 | } /* setget_output */ | 557 | } /* setget_output */ |
559 | 558 | ||
560 | static int | 559 | static int gpio_leds_ioctl(unsigned int cmd, unsigned long arg); |
561 | gpio_leds_ioctl(unsigned int cmd, unsigned long arg); | ||
562 | 560 | ||
563 | static int | 561 | static int |
564 | gpio_ioctl(struct inode *inode, struct file *file, | 562 | gpio_ioctl_unlocked(struct file *file, unsigned int cmd, unsigned long arg) |
565 | unsigned int cmd, unsigned long arg) | ||
566 | { | 563 | { |
567 | unsigned long flags; | 564 | unsigned long flags; |
568 | unsigned long val; | 565 | unsigned long val; |
@@ -707,6 +704,17 @@ gpio_ioctl(struct inode *inode, struct file *file, | |||
707 | return 0; | 704 | return 0; |
708 | } | 705 | } |
709 | 706 | ||
707 | static long gpio_ioctl(struct file *file, unsigned int cmd, unsigned long arg) | ||
708 | { | ||
709 | long ret; | ||
710 | |||
711 | lock_kernel(); | ||
712 | ret = gpio_ioctl_unlocked(file, cmd, arg); | ||
713 | unlock_kernel(); | ||
714 | |||
715 | return ret; | ||
716 | } | ||
717 | |||
710 | #ifdef CONFIG_ETRAX_VIRTUAL_GPIO | 718 | #ifdef CONFIG_ETRAX_VIRTUAL_GPIO |
711 | static int | 719 | static int |
712 | virtual_gpio_ioctl(struct file *file, unsigned int cmd, unsigned long arg) | 720 | 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) | |||
856 | } | 864 | } |
857 | 865 | ||
858 | static const struct file_operations gpio_fops = { | 866 | static const struct file_operations gpio_fops = { |
859 | .owner = THIS_MODULE, | 867 | .owner = THIS_MODULE, |
860 | .poll = gpio_poll, | 868 | .poll = gpio_poll, |
861 | .ioctl = gpio_ioctl, | 869 | .unlocked_ioctl = gpio_ioctl, |
862 | .write = gpio_write, | 870 | .write = gpio_write, |
863 | .open = gpio_open, | 871 | .open = gpio_open, |
864 | .release = gpio_release, | 872 | .release = gpio_release, |
865 | }; | 873 | }; |
866 | 874 | ||
867 | #ifdef CONFIG_ETRAX_VIRTUAL_GPIO | 875 | #ifdef CONFIG_ETRAX_VIRTUAL_GPIO |
diff --git a/arch/cris/arch-v32/drivers/sync_serial.c b/arch/cris/arch-v32/drivers/sync_serial.c index 4889f196ecd6..ca248f3adb80 100644 --- a/arch/cris/arch-v32/drivers/sync_serial.c +++ b/arch/cris/arch-v32/drivers/sync_serial.c | |||
@@ -153,7 +153,7 @@ static int sync_serial_open(struct inode *, struct file*); | |||
153 | static int sync_serial_release(struct inode*, struct file*); | 153 | static int sync_serial_release(struct inode*, struct file*); |
154 | static unsigned int sync_serial_poll(struct file *filp, poll_table *wait); | 154 | static unsigned int sync_serial_poll(struct file *filp, poll_table *wait); |
155 | 155 | ||
156 | static int sync_serial_ioctl(struct inode*, struct file*, | 156 | static int sync_serial_ioctl(struct file *, |
157 | unsigned int cmd, unsigned long arg); | 157 | unsigned int cmd, unsigned long arg); |
158 | static ssize_t sync_serial_write(struct file * file, const char * buf, | 158 | static ssize_t sync_serial_write(struct file * file, const char * buf, |
159 | size_t count, loff_t *ppos); | 159 | size_t count, loff_t *ppos); |
@@ -241,13 +241,13 @@ static struct sync_port ports[]= | |||
241 | #define NBR_PORTS ARRAY_SIZE(ports) | 241 | #define NBR_PORTS ARRAY_SIZE(ports) |
242 | 242 | ||
243 | static const struct file_operations sync_serial_fops = { | 243 | static const struct file_operations sync_serial_fops = { |
244 | .owner = THIS_MODULE, | 244 | .owner = THIS_MODULE, |
245 | .write = sync_serial_write, | 245 | .write = sync_serial_write, |
246 | .read = sync_serial_read, | 246 | .read = sync_serial_read, |
247 | .poll = sync_serial_poll, | 247 | .poll = sync_serial_poll, |
248 | .ioctl = sync_serial_ioctl, | 248 | .unlocked_ioctl = sync_serial_ioctl, |
249 | .open = sync_serial_open, | 249 | .open = sync_serial_open, |
250 | .release = sync_serial_release | 250 | .release = sync_serial_release |
251 | }; | 251 | }; |
252 | 252 | ||
253 | static int __init etrax_sync_serial_init(void) | 253 | static int __init etrax_sync_serial_init(void) |
@@ -650,7 +650,7 @@ static unsigned int sync_serial_poll(struct file *file, poll_table *wait) | |||
650 | return mask; | 650 | return mask; |
651 | } | 651 | } |
652 | 652 | ||
653 | static int sync_serial_ioctl(struct inode *inode, struct file *file, | 653 | static int sync_serial_ioctl(struct file *file, |
654 | unsigned int cmd, unsigned long arg) | 654 | unsigned int cmd, unsigned long arg) |
655 | { | 655 | { |
656 | int return_val = 0; | 656 | int return_val = 0; |
@@ -961,6 +961,18 @@ static int sync_serial_ioctl(struct inode *inode, struct file *file, | |||
961 | return return_val; | 961 | return return_val; |
962 | } | 962 | } |
963 | 963 | ||
964 | static long sync_serial_ioctl(struct file *file, | ||
965 | unsigned int cmd, unsigned long arg) | ||
966 | { | ||
967 | long ret; | ||
968 | |||
969 | lock_kernel(); | ||
970 | ret = sync_serial_ioctl_unlocked(file, cmd, arg); | ||
971 | unlock_kernel(); | ||
972 | |||
973 | return ret; | ||
974 | } | ||
975 | |||
964 | /* NOTE: sync_serial_write does not support concurrency */ | 976 | /* NOTE: sync_serial_write does not support concurrency */ |
965 | static ssize_t sync_serial_write(struct file *file, const char *buf, | 977 | static ssize_t sync_serial_write(struct file *file, const char *buf, |
966 | size_t count, loff_t *ppos) | 978 | size_t count, loff_t *ppos) |