]> git.karo-electronics.de Git - mv-sheeva.git/blobdiff - drivers/macintosh/via-pmu.c
Merge branch 'master' into tk71
[mv-sheeva.git] / drivers / macintosh / via-pmu.c
index 2d17e76066bd0b640890d8a0e0ddc5ac7170ec85..8b021eb0d48cd98131e2ecd7ef58e2574959a7ab 100644 (file)
@@ -18,7 +18,7 @@
  *
  */
 #include <stdarg.h>
-#include <linux/smp_lock.h>
+#include <linux/mutex.h>
 #include <linux/types.h>
 #include <linux/errno.h>
 #include <linux/kernel.h>
@@ -73,6 +73,7 @@
 /* How many iterations between battery polls */
 #define BATTERY_POLLING_COUNT  2
 
+static DEFINE_MUTEX(pmu_info_proc_mutex);
 static volatile unsigned char __iomem *via;
 
 /* VIA registers - spaced 0x200 bytes apart */
@@ -2078,7 +2079,7 @@ pmu_open(struct inode *inode, struct file *file)
        pp->rb_get = pp->rb_put = 0;
        spin_lock_init(&pp->lock);
        init_waitqueue_head(&pp->wait);
-       lock_kernel();
+       mutex_lock(&pmu_info_proc_mutex);
        spin_lock_irqsave(&all_pvt_lock, flags);
 #if defined(CONFIG_INPUT_ADBHID) && defined(CONFIG_PMAC_BACKLIGHT)
        pp->backlight_locker = 0;
@@ -2086,7 +2087,7 @@ pmu_open(struct inode *inode, struct file *file)
        list_add(&pp->list, &all_pmu_pvt);
        spin_unlock_irqrestore(&all_pvt_lock, flags);
        file->private_data = pp;
-       unlock_kernel();
+       mutex_unlock(&pmu_info_proc_mutex);
        return 0;
 }
 
@@ -2256,7 +2257,7 @@ static int pmu_sleep_valid(suspend_state_t state)
                && (pmac_call_feature(PMAC_FTR_SLEEP_STATE, NULL, 0, -1) >= 0);
 }
 
-static struct platform_suspend_ops pmu_pm_ops = {
+static const struct platform_suspend_ops pmu_pm_ops = {
        .enter = powerbook_sleep,
        .valid = pmu_sleep_valid,
 };
@@ -2343,9 +2344,9 @@ static long pmu_unlocked_ioctl(struct file *filp,
 {
        int ret;
 
-       lock_kernel();
+       mutex_lock(&pmu_info_proc_mutex);
        ret = pmu_ioctl(filp, cmd, arg);
-       unlock_kernel();
+       mutex_unlock(&pmu_info_proc_mutex);
 
        return ret;
 }
@@ -2398,6 +2399,7 @@ static const struct file_operations pmu_device_fops = {
 #endif
        .open           = pmu_open,
        .release        = pmu_release,
+       .llseek         = noop_llseek,
 };
 
 static struct miscdevice pmu_device = {