i2c-smbus: Use device_lock/device_unlock
authorStephen Rothwell <sfr@canb.auug.org.au>
Mon, 1 Mar 2010 05:04:45 +0000 (16:04 +1100)
committerJean Delvare <khali@linux-fr.org>
Sat, 13 Mar 2010 19:56:51 +0000 (20:56 +0100)
Use the new device locking/unlocking API.

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
drivers/i2c/i2c-smbus.c

index 421278221243bb8c73087f42b1b1979d3b5c4b66..7a8201ed21816a0fe9df1e6ca0472b710c5ed289 100644 (file)
@@ -22,7 +22,6 @@
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/device.h>
-#include <linux/semaphore.h>
 #include <linux/interrupt.h>
 #include <linux/workqueue.h>
 #include <linux/i2c.h>
@@ -55,7 +54,7 @@ static int smbus_do_alert(struct device *dev, void *addrp)
         * Drivers should either disable alerts, or provide at least
         * a minimal handler.  Lock so client->driver won't change.
         */
-       down(&dev->sem);
+       device_lock(dev);
        if (client->driver) {
                if (client->driver->alert)
                        client->driver->alert(client, data->flag);
@@ -63,7 +62,7 @@ static int smbus_do_alert(struct device *dev, void *addrp)
                        dev_warn(&client->dev, "no driver alert()!\n");
        } else
                dev_dbg(&client->dev, "alert with no driver\n");
-       up(&dev->sem);
+       device_unlock(dev);
 
        /* Stop iterating after we find the device */
        return -EBUSY;