summaryrefslogtreecommitdiffstats
path: root/drivers/i2c/i2c-smbus.c
diff options
context:
space:
mode:
authorStephen Rothwell <sfr@canb.auug.org.au>2010-03-01 06:04:45 +0100
committerJean Delvare <khali@linux-fr.org>2010-03-13 20:56:51 +0100
commitf635a1e74bd6001f06fe1df53d32daf2b28bf04b (patch)
tree14d4556054ac6deaea1060ebb0a9b2a3fb5bd766 /drivers/i2c/i2c-smbus.c
parentMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/sam... (diff)
downloadlinux-f635a1e74bd6001f06fe1df53d32daf2b28bf04b.tar.xz
linux-f635a1e74bd6001f06fe1df53d32daf2b28bf04b.zip
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 @@
#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;