aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/apm-emulation.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/apm-emulation.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/apm-emulation.c')
-rw-r--r--drivers/char/apm-emulation.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/char/apm-emulation.c b/drivers/char/apm-emulation.c
index 4f568cb9af3f..033e1505fca9 100644
--- a/drivers/char/apm-emulation.c
+++ b/drivers/char/apm-emulation.c
@@ -265,8 +265,8 @@ static unsigned int apm_poll(struct file *fp, poll_table * wait)
265 * Only when everyone who has opened /dev/apm_bios with write permission 265 * Only when everyone who has opened /dev/apm_bios with write permission
266 * has acknowledge does the actual suspend happen. 266 * has acknowledge does the actual suspend happen.
267 */ 267 */
268static int 268static long
269apm_ioctl(struct inode * inode, struct file *filp, u_int cmd, u_long arg) 269apm_ioctl(struct file *filp, u_int cmd, u_long arg)
270{ 270{
271 struct apm_user *as = filp->private_data; 271 struct apm_user *as = filp->private_data;
272 int err = -EINVAL; 272 int err = -EINVAL;
@@ -274,6 +274,7 @@ apm_ioctl(struct inode * inode, struct file *filp, u_int cmd, u_long arg)
274 if (!as->suser || !as->writer) 274 if (!as->suser || !as->writer)
275 return -EPERM; 275 return -EPERM;
276 276
277 lock_kernel();
277 switch (cmd) { 278 switch (cmd) {
278 case APM_IOC_SUSPEND: 279 case APM_IOC_SUSPEND:
279 mutex_lock(&state_lock); 280 mutex_lock(&state_lock);
@@ -334,6 +335,7 @@ apm_ioctl(struct inode * inode, struct file *filp, u_int cmd, u_long arg)
334 mutex_unlock(&state_lock); 335 mutex_unlock(&state_lock);
335 break; 336 break;
336 } 337 }
338 unlock_kernel();
337 339
338 return err; 340 return err;
339} 341}
@@ -397,7 +399,7 @@ static const struct file_operations apm_bios_fops = {
397 .owner = THIS_MODULE, 399 .owner = THIS_MODULE,
398 .read = apm_read, 400 .read = apm_read,
399 .poll = apm_poll, 401 .poll = apm_poll,
400 .ioctl = apm_ioctl, 402 .unlocked_ioctl = apm_ioctl,
401 .open = apm_open, 403 .open = apm_open,
402 .release = apm_release, 404 .release = apm_release,
403}; 405};