aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/apm-emulation.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/char/apm-emulation.c')
-rw-r--r--drivers/char/apm-emulation.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/drivers/char/apm-emulation.c b/drivers/char/apm-emulation.c
index 033e1505fca9..548708c4b2b8 100644
--- a/drivers/char/apm-emulation.c
+++ b/drivers/char/apm-emulation.c
@@ -7,13 +7,13 @@
7 * Intel Corporation, Microsoft Corporation. Advanced Power Management 7 * Intel Corporation, Microsoft Corporation. Advanced Power Management
8 * (APM) BIOS Interface Specification, Revision 1.2, February 1996. 8 * (APM) BIOS Interface Specification, Revision 1.2, February 1996.
9 * 9 *
10 * [This document is available from Microsoft at: 10 * This document is available from Microsoft at:
11 * http://www.microsoft.com/hwdev/busbios/amp_12.htm] 11 * http://www.microsoft.com/whdc/archive/amp_12.mspx
12 */ 12 */
13#include <linux/module.h> 13#include <linux/module.h>
14#include <linux/poll.h> 14#include <linux/poll.h>
15#include <linux/slab.h> 15#include <linux/slab.h>
16#include <linux/smp_lock.h> 16#include <linux/mutex.h>
17#include <linux/proc_fs.h> 17#include <linux/proc_fs.h>
18#include <linux/seq_file.h> 18#include <linux/seq_file.h>
19#include <linux/miscdevice.h> 19#include <linux/miscdevice.h>
@@ -274,7 +274,6 @@ apm_ioctl(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();
278 switch (cmd) { 277 switch (cmd) {
279 case APM_IOC_SUSPEND: 278 case APM_IOC_SUSPEND:
280 mutex_lock(&state_lock); 279 mutex_lock(&state_lock);
@@ -335,7 +334,6 @@ apm_ioctl(struct file *filp, u_int cmd, u_long arg)
335 mutex_unlock(&state_lock); 334 mutex_unlock(&state_lock);
336 break; 335 break;
337 } 336 }
338 unlock_kernel();
339 337
340 return err; 338 return err;
341} 339}
@@ -370,7 +368,6 @@ static int apm_open(struct inode * inode, struct file * filp)
370{ 368{
371 struct apm_user *as; 369 struct apm_user *as;
372 370
373 lock_kernel();
374 as = kzalloc(sizeof(*as), GFP_KERNEL); 371 as = kzalloc(sizeof(*as), GFP_KERNEL);
375 if (as) { 372 if (as) {
376 /* 373 /*
@@ -390,7 +387,6 @@ static int apm_open(struct inode * inode, struct file * filp)
390 387
391 filp->private_data = as; 388 filp->private_data = as;
392 } 389 }
393 unlock_kernel();
394 390
395 return as ? 0 : -ENOMEM; 391 return as ? 0 : -ENOMEM;
396} 392}
@@ -402,6 +398,7 @@ static const struct file_operations apm_bios_fops = {
402 .unlocked_ioctl = apm_ioctl, 398 .unlocked_ioctl = apm_ioctl,
403 .open = apm_open, 399 .open = apm_open,
404 .release = apm_release, 400 .release = apm_release,
401 .llseek = noop_llseek,
405}; 402};
406 403
407static struct miscdevice apm_device = { 404static struct miscdevice apm_device = {