From: Stephen Rothwell Date: Mon, 1 Mar 2010 05:04:45 +0000 (+1100) Subject: i2c-smbus: Use device_lock/device_unlock X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=f635a1e74bd6001f06fe1df53d32daf2b28bf04b;p=GitHub%2Fmt8127%2Fandroid_kernel_alcatel_ttab.git i2c-smbus: Use device_lock/device_unlock Use the new device locking/unlocking API. Signed-off-by: Stephen Rothwell Signed-off-by: Jean Delvare --- 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 #include #include -#include #include #include #include @@ -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;