aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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;