aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/raw.c
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2010-04-26 18:24:05 -0400
committerFrederic Weisbecker <fweisbec@gmail.com>2010-05-16 23:27:41 -0400
commit55929332c92e5d34d65a8f784604c92677ea3e15 (patch)
tree555e922d470336d07ace32bb564ac5358379a3c4 /drivers/char/raw.c
parent703c631ebbcadcfd861d01e697fdda7c388fec9a (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/raw.c')
-rw-r--r--drivers/char/raw.c42
1 files changed, 24 insertions, 18 deletions
diff --git a/drivers/char/raw.c b/drivers/char/raw.c
index 8756ab0daa8b..b38942f6bf31 100644
--- a/drivers/char/raw.c
+++ b/drivers/char/raw.c
@@ -121,13 +121,17 @@ static int raw_release(struct inode *inode, struct file *filp)
121/* 121/*
122 * Forward ioctls to the underlying block device. 122 * Forward ioctls to the underlying block device.
123 */ 123 */
124static int 124static long
125raw_ioctl(struct inode *inode, struct file *filp, 125raw_ioctl(struct file *filp, unsigned int command, unsigned long arg)
126 unsigned int command, unsigned long arg)
127{ 126{
128 struct block_device *bdev = filp->private_data; 127 struct block_device *bdev = filp->private_data;
128 int ret;
129
130 lock_kernel();
131 ret = blkdev_ioctl(bdev, 0, command, arg);
132 unlock_kernel();
129 133
130 return blkdev_ioctl(bdev, 0, command, arg); 134 return ret;
131} 135}
132 136
133static void bind_device(struct raw_config_request *rq) 137static void bind_device(struct raw_config_request *rq)
@@ -141,13 +145,14 @@ static void bind_device(struct raw_config_request *rq)
141 * Deal with ioctls against the raw-device control interface, to bind 145 * Deal with ioctls against the raw-device control interface, to bind
142 * and unbind other raw devices. 146 * and unbind other raw devices.
143 */ 147 */
144static int raw_ctl_ioctl(struct inode *inode, struct file *filp, 148static long raw_ctl_ioctl(struct file *filp, unsigned int command,
145 unsigned int command, unsigned long arg) 149 unsigned long arg)
146{ 150{
147 struct raw_config_request rq; 151 struct raw_config_request rq;
148 struct raw_device_data *rawdev; 152 struct raw_device_data *rawdev;
149 int err = 0; 153 int err = 0;
150 154
155 lock_kernel();
151 switch (command) { 156 switch (command) {
152 case RAW_SETBIND: 157 case RAW_SETBIND:
153 case RAW_GETBIND: 158 case RAW_GETBIND:
@@ -240,25 +245,26 @@ static int raw_ctl_ioctl(struct inode *inode, struct file *filp,
240 break; 245 break;
241 } 246 }
242out: 247out:
248 unlock_kernel();
243 return err; 249 return err;
244} 250}
245 251
246static const struct file_operations raw_fops = { 252static const struct file_operations raw_fops = {
247 .read = do_sync_read, 253 .read = do_sync_read,
248 .aio_read = generic_file_aio_read, 254 .aio_read = generic_file_aio_read,
249 .write = do_sync_write, 255 .write = do_sync_write,
250 .aio_write = blkdev_aio_write, 256 .aio_write = blkdev_aio_write,
251 .fsync = blkdev_fsync, 257 .fsync = blkdev_fsync,
252 .open = raw_open, 258 .open = raw_open,
253 .release= raw_release, 259 .release = raw_release,
254 .ioctl = raw_ioctl, 260 .unlocked_ioctl = raw_ioctl,
255 .owner = THIS_MODULE, 261 .owner = THIS_MODULE,
256}; 262};
257 263
258static const struct file_operations raw_ctl_fops = { 264static const struct file_operations raw_ctl_fops = {
259 .ioctl = raw_ctl_ioctl, 265 .unlocked_ioctl = raw_ctl_ioctl,
260 .open = raw_open, 266 .open = raw_open,
261 .owner = THIS_MODULE, 267 .owner = THIS_MODULE,
262}; 268};
263 269
264static struct cdev raw_cdev; 270static struct cdev raw_cdev;