Merge branch 'for-2.6.40/core' of git://git.kernel.dk/linux-2.6-block
[firefly-linux-kernel-4.4.55.git] / drivers / char / apm-emulation.c
index 3022801669b148b35bc9174c19a7bbf559ec7cd6..548708c4b2b84fbc3200b843bb701e154550244b 100644 (file)
@@ -7,8 +7,8 @@
  *   Intel Corporation, Microsoft Corporation. Advanced Power Management
  *   (APM) BIOS Interface Specification, Revision 1.2, February 1996.
  *
- * [This document is available from Microsoft at:
- *    http://www.microsoft.com/hwdev/busbios/amp_12.htm]
+ * This document is available from Microsoft at:
+ *    http://www.microsoft.com/whdc/archive/amp_12.mspx
  */
 #include <linux/module.h>
 #include <linux/poll.h>
@@ -126,7 +126,6 @@ struct apm_user {
 /*
  * Local variables
  */
-static DEFINE_MUTEX(apm_mutex);
 static atomic_t suspend_acks_pending = ATOMIC_INIT(0);
 static atomic_t userspace_notification_inhibit = ATOMIC_INIT(0);
 static int apm_disabled;
@@ -275,7 +274,6 @@ apm_ioctl(struct file *filp, u_int cmd, u_long arg)
        if (!as->suser || !as->writer)
                return -EPERM;
 
-       mutex_lock(&apm_mutex);
        switch (cmd) {
        case APM_IOC_SUSPEND:
                mutex_lock(&state_lock);
@@ -336,7 +334,6 @@ apm_ioctl(struct file *filp, u_int cmd, u_long arg)
                mutex_unlock(&state_lock);
                break;
        }
-       mutex_unlock(&apm_mutex);
 
        return err;
 }
@@ -371,7 +368,6 @@ static int apm_open(struct inode * inode, struct file * filp)
 {
        struct apm_user *as;
 
-       mutex_lock(&apm_mutex);
        as = kzalloc(sizeof(*as), GFP_KERNEL);
        if (as) {
                /*
@@ -391,7 +387,6 @@ static int apm_open(struct inode * inode, struct file * filp)
 
                filp->private_data = as;
        }
-       mutex_unlock(&apm_mutex);
 
        return as ? 0 : -ENOMEM;
 }