aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/i2c/i2c-smbus.c
diff options
context:
space:
mode:
authorStephen Rothwell <sfr@canb.auug.org.au>2010-03-01 00:04:45 -0500
committerJean Delvare <khali@linux-fr.org>2010-03-13 14:56:51 -0500
commitf635a1e74bd6001f06fe1df53d32daf2b28bf04b (patch)
tree14d4556054ac6deaea1060ebb0a9b2a3fb5bd766 /drivers/i2c/i2c-smbus.c
parentdaf9fe2ee9a203c4fc555cfe5c5f3d9f660e743c (diff)
i2c-smbus: Use device_lock/device_unlock
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>
Diffstat (limited to 'drivers/i2c/i2c-smbus.c')
-rw-r--r--drivers/i2c/i2c-smbus.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/i2c/i2c-smbus.c b/drivers/i2c/i2c-smbus.c
index 421278221243..7a8201ed2181 100644
--- a/drivers/i2c/i2c-smbus.c
+++ b/drivers/i2c/i2c-smbus.c
@@ -22,7 +22,6 @@
22#include <linux/kernel.h> 22#include <linux/kernel.h>
23#include <linux/module.h> 23#include <linux/module.h>
24#include <linux/device.h> 24#include <linux/device.h>
25#include <linux/semaphore.h>
26#include <linux/interrupt.h> 25#include <linux/interrupt.h>
27#include <linux/workqueue.h> 26#include <linux/workqueue.h>
28#include <linux/i2c.h> 27#include <linux/i2c.h>
@@ -55,7 +54,7 @@ static int smbus_do_alert(struct device *dev, void *addrp)
55 * Drivers should either disable alerts, or provide at least 54 * Drivers should either disable alerts, or provide at least
56 * a minimal handler. Lock so client->driver won't change. 55 * a minimal handler. Lock so client->driver won't change.
57 */ 56 */
58 down(&dev->sem); 57 device_lock(dev);
59 if (client->driver) { 58 if (client->driver) {
60 if (client->driver->alert) 59 if (client->driver->alert)
61 client->driver->alert(client, data->flag); 60 client->driver->alert(client, data->flag);
@@ -63,7 +62,7 @@ static int smbus_do_alert(struct device *dev, void *addrp)
63 dev_warn(&client->dev, "no driver alert()!\n"); 62 dev_warn(&client->dev, "no driver alert()!\n");
64 } else 63 } else
65 dev_dbg(&client->dev, "alert with no driver\n"); 64 dev_dbg(&client->dev, "alert with no driver\n");
66 up(&dev->sem); 65 device_unlock(dev);
67 66
68 /* Stop iterating after we find the device */ 67 /* Stop iterating after we find the device */
69 return -EBUSY; 68 return -EBUSY;