]> git.karo-electronics.de Git - mv-sheeva.git/blobdiff - kernel/power/user.c
PM / Sleep: Replace mutex_[un]lock(&pm_mutex) with [un]lock_system_sleep()
[mv-sheeva.git] / kernel / power / user.c
index 06ea33df856092ed0cc9f7dba070697a73b00ee0..98ade217da6c2c8d032c78a56d5358170d12819d 100644 (file)
@@ -71,7 +71,7 @@ static int snapshot_open(struct inode *inode, struct file *filp)
        struct snapshot_data *data;
        int error;
 
-       mutex_lock(&pm_mutex);
+       lock_system_sleep();
 
        if (!atomic_add_unless(&snapshot_device_available, -1, 0)) {
                error = -EBUSY;
@@ -123,7 +123,7 @@ static int snapshot_open(struct inode *inode, struct file *filp)
        data->platform_support = 0;
 
  Unlock:
-       mutex_unlock(&pm_mutex);
+       unlock_system_sleep();
 
        return error;
 }
@@ -132,7 +132,7 @@ static int snapshot_release(struct inode *inode, struct file *filp)
 {
        struct snapshot_data *data;
 
-       mutex_lock(&pm_mutex);
+       lock_system_sleep();
 
        swsusp_free();
        free_basic_memory_bitmaps();
@@ -146,7 +146,7 @@ static int snapshot_release(struct inode *inode, struct file *filp)
                        PM_POST_HIBERNATION : PM_POST_RESTORE);
        atomic_inc(&snapshot_device_available);
 
-       mutex_unlock(&pm_mutex);
+       unlock_system_sleep();
 
        return 0;
 }
@@ -158,7 +158,7 @@ static ssize_t snapshot_read(struct file *filp, char __user *buf,
        ssize_t res;
        loff_t pg_offp = *offp & ~PAGE_MASK;
 
-       mutex_lock(&pm_mutex);
+       lock_system_sleep();
 
        data = filp->private_data;
        if (!data->ready) {
@@ -179,7 +179,7 @@ static ssize_t snapshot_read(struct file *filp, char __user *buf,
                *offp += res;
 
  Unlock:
-       mutex_unlock(&pm_mutex);
+       unlock_system_sleep();
 
        return res;
 }
@@ -191,7 +191,7 @@ static ssize_t snapshot_write(struct file *filp, const char __user *buf,
        ssize_t res;
        loff_t pg_offp = *offp & ~PAGE_MASK;
 
-       mutex_lock(&pm_mutex);
+       lock_system_sleep();
 
        data = filp->private_data;
 
@@ -208,7 +208,7 @@ static ssize_t snapshot_write(struct file *filp, const char __user *buf,
        if (res > 0)
                *offp += res;
 unlock:
-       mutex_unlock(&pm_mutex);
+       unlock_system_sleep();
 
        return res;
 }