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/char/generic_nvram.c | |
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/char/generic_nvram.c')
-rw-r--r-- | drivers/char/generic_nvram.c | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/drivers/char/generic_nvram.c b/drivers/char/generic_nvram.c index fda4181b5e67..82b5a88a82d7 100644 --- a/drivers/char/generic_nvram.c +++ b/drivers/char/generic_nvram.c | |||
@@ -19,6 +19,7 @@ | |||
19 | #include <linux/miscdevice.h> | 19 | #include <linux/miscdevice.h> |
20 | #include <linux/fcntl.h> | 20 | #include <linux/fcntl.h> |
21 | #include <linux/init.h> | 21 | #include <linux/init.h> |
22 | #include <linux/smp_lock.h> | ||
22 | #include <asm/uaccess.h> | 23 | #include <asm/uaccess.h> |
23 | #include <asm/nvram.h> | 24 | #include <asm/nvram.h> |
24 | #ifdef CONFIG_PPC_PMAC | 25 | #ifdef CONFIG_PPC_PMAC |
@@ -84,8 +85,7 @@ static ssize_t write_nvram(struct file *file, const char __user *buf, | |||
84 | return p - buf; | 85 | return p - buf; |
85 | } | 86 | } |
86 | 87 | ||
87 | static int nvram_ioctl(struct inode *inode, struct file *file, | 88 | static int nvram_ioctl(struct file *file, unsigned int cmd, unsigned long arg) |
88 | unsigned int cmd, unsigned long arg) | ||
89 | { | 89 | { |
90 | switch(cmd) { | 90 | switch(cmd) { |
91 | #ifdef CONFIG_PPC_PMAC | 91 | #ifdef CONFIG_PPC_PMAC |
@@ -116,12 +116,23 @@ static int nvram_ioctl(struct inode *inode, struct file *file, | |||
116 | return 0; | 116 | return 0; |
117 | } | 117 | } |
118 | 118 | ||
119 | static long nvram_unlocked_ioctl(struct file *file, unsigned int cmd, unsigned long arg) | ||
120 | { | ||
121 | int ret; | ||
122 | |||
123 | lock_kernel(); | ||
124 | ret = nvram_ioctl(file, cmd, arg); | ||
125 | unlock_kernel(); | ||
126 | |||
127 | return ret; | ||
128 | } | ||
129 | |||
119 | const struct file_operations nvram_fops = { | 130 | const struct file_operations nvram_fops = { |
120 | .owner = THIS_MODULE, | 131 | .owner = THIS_MODULE, |
121 | .llseek = nvram_llseek, | 132 | .llseek = nvram_llseek, |
122 | .read = read_nvram, | 133 | .read = read_nvram, |
123 | .write = write_nvram, | 134 | .write = write_nvram, |
124 | .ioctl = nvram_ioctl, | 135 | .unlocked_ioctl = nvram_unlocked_ioctl, |
125 | }; | 136 | }; |
126 | 137 | ||
127 | static struct miscdevice nvram_dev = { | 138 | static struct miscdevice nvram_dev = { |