Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Stephen Rothwell and committed by
Jean Delvare
f635a1e7 daf9fe2e

+2 -3
+2 -3
drivers/i2c/i2c-smbus.c
··· 22 22 #include <linux/kernel.h> 23 23 #include <linux/module.h> 24 24 #include <linux/device.h> 25 - #include <linux/semaphore.h> 26 25 #include <linux/interrupt.h> 27 26 #include <linux/workqueue.h> 28 27 #include <linux/i2c.h> ··· 54 55 * Drivers should either disable alerts, or provide at least 55 56 * a minimal handler. Lock so client->driver won't change. 56 57 */ 57 - down(&dev->sem); 58 + device_lock(dev); 58 59 if (client->driver) { 59 60 if (client->driver->alert) 60 61 client->driver->alert(client, data->flag); ··· 62 63 dev_warn(&client->dev, "no driver alert()!\n"); 63 64 } else 64 65 dev_dbg(&client->dev, "alert with no driver\n"); 65 - up(&dev->sem); 66 + device_unlock(dev); 66 67 67 68 /* Stop iterating after we find the device */ 68 69 return -EBUSY;