Commit f635a1e7 authored by Stephen Rothwell's avatar Stephen Rothwell Committed by Jean Delvare

i2c-smbus: Use device_lock/device_unlock

Use the new device locking/unlocking API.
Signed-off-by: default avatarStephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: default avatarJean Delvare <khali@linux-fr.org>
parent daf9fe2e
...@@ -22,7 +22,6 @@ ...@@ -22,7 +22,6 @@
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/device.h> #include <linux/device.h>
#include <linux/semaphore.h>
#include <linux/interrupt.h> #include <linux/interrupt.h>
#include <linux/workqueue.h> #include <linux/workqueue.h>
#include <linux/i2c.h> #include <linux/i2c.h>
...@@ -55,7 +54,7 @@ static int smbus_do_alert(struct device *dev, void *addrp) ...@@ -55,7 +54,7 @@ static int smbus_do_alert(struct device *dev, void *addrp)
* Drivers should either disable alerts, or provide at least * Drivers should either disable alerts, or provide at least
* a minimal handler. Lock so client->driver won't change. * a minimal handler. Lock so client->driver won't change.
*/ */
down(&dev->sem); device_lock(dev);
if (client->driver) { if (client->driver) {
if (client->driver->alert) if (client->driver->alert)
client->driver->alert(client, data->flag); client->driver->alert(client, data->flag);
...@@ -63,7 +62,7 @@ static int smbus_do_alert(struct device *dev, void *addrp) ...@@ -63,7 +62,7 @@ static int smbus_do_alert(struct device *dev, void *addrp)
dev_warn(&client->dev, "no driver alert()!\n"); dev_warn(&client->dev, "no driver alert()!\n");
} else } else
dev_dbg(&client->dev, "alert with no driver\n"); dev_dbg(&client->dev, "alert with no driver\n");
up(&dev->sem); device_unlock(dev);
/* Stop iterating after we find the device */ /* Stop iterating after we find the device */
return -EBUSY; return -EBUSY;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment