diff options
author | Arnd Bergmann <arnd@arndb.de> | 2010-04-26 18:24:05 -0400 |
---|---|---|
committer | Frederic Weisbecker <fweisbec@gmail.com> | 2010-05-16 23:27:41 -0400 |
commit | 55929332c92e5d34d65a8f784604c92677ea3e15 (patch) | |
tree | 555e922d470336d07ace32bb564ac5358379a3c4 /drivers/mtd | |
parent | 703c631ebbcadcfd861d01e697fdda7c388fec9a (diff) |
drivers: Push down BKL into various drivers
These are the last remaining device drivers using
the ->ioctl file operation in the drivers directory
(except from v4l drivers).
[fweisbec: drop i8k pushdown as it has been done from
procfs pushdown branch already]
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Diffstat (limited to 'drivers/mtd')
-rw-r--r-- | drivers/mtd/mtdchar.c | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/drivers/mtd/mtdchar.c b/drivers/mtd/mtdchar.c index 5b081cb84351..6749c2f96342 100644 --- a/drivers/mtd/mtdchar.c +++ b/drivers/mtd/mtdchar.c | |||
@@ -450,8 +450,7 @@ static int mtd_do_readoob(struct mtd_info *mtd, uint64_t start, | |||
450 | return ret; | 450 | return ret; |
451 | } | 451 | } |
452 | 452 | ||
453 | static int mtd_ioctl(struct inode *inode, struct file *file, | 453 | static int mtd_ioctl(struct file *file, u_int cmd, u_long arg) |
454 | u_int cmd, u_long arg) | ||
455 | { | 454 | { |
456 | struct mtd_file_info *mfi = file->private_data; | 455 | struct mtd_file_info *mfi = file->private_data; |
457 | struct mtd_info *mtd = mfi->mtd; | 456 | struct mtd_info *mtd = mfi->mtd; |
@@ -822,6 +821,17 @@ static int mtd_ioctl(struct inode *inode, struct file *file, | |||
822 | return ret; | 821 | return ret; |
823 | } /* memory_ioctl */ | 822 | } /* memory_ioctl */ |
824 | 823 | ||
824 | static long mtd_unlocked_ioctl(struct file *file, u_int cmd, u_long arg) | ||
825 | { | ||
826 | int ret; | ||
827 | |||
828 | lock_kernel(); | ||
829 | ret = mtd_ioctl(file, cmd, arg); | ||
830 | unlock_kernel(); | ||
831 | |||
832 | return ret; | ||
833 | } | ||
834 | |||
825 | #ifdef CONFIG_COMPAT | 835 | #ifdef CONFIG_COMPAT |
826 | 836 | ||
827 | struct mtd_oob_buf32 { | 837 | struct mtd_oob_buf32 { |
@@ -836,7 +846,6 @@ struct mtd_oob_buf32 { | |||
836 | static long mtd_compat_ioctl(struct file *file, unsigned int cmd, | 846 | static long mtd_compat_ioctl(struct file *file, unsigned int cmd, |
837 | unsigned long arg) | 847 | unsigned long arg) |
838 | { | 848 | { |
839 | struct inode *inode = file->f_path.dentry->d_inode; | ||
840 | struct mtd_file_info *mfi = file->private_data; | 849 | struct mtd_file_info *mfi = file->private_data; |
841 | struct mtd_info *mtd = mfi->mtd; | 850 | struct mtd_info *mtd = mfi->mtd; |
842 | void __user *argp = compat_ptr(arg); | 851 | void __user *argp = compat_ptr(arg); |
@@ -874,7 +883,7 @@ static long mtd_compat_ioctl(struct file *file, unsigned int cmd, | |||
874 | break; | 883 | break; |
875 | } | 884 | } |
876 | default: | 885 | default: |
877 | ret = mtd_ioctl(inode, file, cmd, (unsigned long)argp); | 886 | ret = mtd_ioctl(file, cmd, (unsigned long)argp); |
878 | } | 887 | } |
879 | 888 | ||
880 | unlock_kernel(); | 889 | unlock_kernel(); |
@@ -942,7 +951,7 @@ static const struct file_operations mtd_fops = { | |||
942 | .llseek = mtd_lseek, | 951 | .llseek = mtd_lseek, |
943 | .read = mtd_read, | 952 | .read = mtd_read, |
944 | .write = mtd_write, | 953 | .write = mtd_write, |
945 | .ioctl = mtd_ioctl, | 954 | .unlocked_ioctl = mtd_unlocked_ioctl, |
946 | #ifdef CONFIG_COMPAT | 955 | #ifdef CONFIG_COMPAT |
947 | .compat_ioctl = mtd_compat_ioctl, | 956 | .compat_ioctl = mtd_compat_ioctl, |
948 | #endif | 957 | #endif |