]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
wm97xx_battery: Use DEFINE_MUTEX() for work_lock
authorAxel Lin <axel.lin@gmail.com>
Mon, 28 Nov 2011 14:37:35 +0000 (22:37 +0800)
committerAnton Vorontsov <cbouatmailru@gmail.com>
Fri, 6 Jan 2012 01:00:30 +0000 (05:00 +0400)
work_lock can be initialized automatically with
DEFINE_MUTEX() rather than explicitly calling mutex_init().

This patch also removes an unused bat_lock mutex.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>
drivers/power/wm97xx_battery.c

index 199818f9d18128ccc0b72b386c7dd21fe0dee67f..d2d4c08c681cd99f1eef9b1a477830289b533f70 100644 (file)
@@ -25,9 +25,8 @@
 #include <linux/irq.h>
 #include <linux/slab.h>
 
-static DEFINE_MUTEX(bat_lock);
 static struct work_struct bat_work;
-static struct mutex work_lock;
+static DEFINE_MUTEX(work_lock);
 static int bat_status = POWER_SUPPLY_STATUS_UNKNOWN;
 static enum power_supply_property *prop;
 
@@ -181,8 +180,6 @@ static int __devinit wm97xx_bat_probe(struct platform_device *dev)
        if (dev->id != -1)
                return -EINVAL;
 
-       mutex_init(&work_lock);
-
        if (!pdata) {
                dev_err(&dev->dev, "No platform_data supplied\n");
                return -EINVAL;