hwmon: (ams) Fix locking issues
[safe/jmp/linux-2.6] / drivers / hwmon / ams / ams-pmu.c
index 9463e97..fb18b3d 100644 (file)
@@ -149,8 +149,6 @@ int __init ams_pmu_init(struct device_node *np)
        const u32 *prop;
        int result;
 
-       mutex_lock(&ams_info.lock);
-
        /* Set implementation stuff */
        ams_info.of_node = np;
        ams_info.exit = ams_pmu_exit;
@@ -161,10 +159,9 @@ int __init ams_pmu_init(struct device_node *np)
 
        /* Get PMU command, should be 0x4e, but we can never know */
        prop = of_get_property(ams_info.of_node, "reg", NULL);
-       if (!prop) {
-               result = -ENODEV;
-               goto exit;
-       }
+       if (!prop)
+               return -ENODEV;
+
        ams_pmu_cmd = ((*prop) >> 8) & 0xff;
 
        /* Disable interrupts */
@@ -175,7 +172,7 @@ int __init ams_pmu_init(struct device_node *np)
 
        result = ams_sensor_attach();
        if (result < 0)
-               goto exit;
+               return result;
 
        /* Set default values */
        ams_pmu_set_register(AMS_FF_LOW_LIMIT, 0x15);
@@ -198,10 +195,5 @@ int __init ams_pmu_init(struct device_node *np)
 
        printk(KERN_INFO "ams: Found PMU based motion sensor\n");
 
-       result = 0;
-
-exit:
-       mutex_unlock(&ams_info.lock);
-
-       return result;
+       return 0;
 }