aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/i2c/i2c-smbus.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/i2c/i2c-smbus.c')
-rw-r--r--drivers/i2c/i2c-smbus.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/i2c/i2c-smbus.c b/drivers/i2c/i2c-smbus.c
index 44d4c6071c15..c99b22987366 100644
--- a/drivers/i2c/i2c-smbus.c
+++ b/drivers/i2c/i2c-smbus.c
@@ -46,6 +46,7 @@ static int smbus_do_alert(struct device *dev, void *addrp)
46{ 46{
47 struct i2c_client *client = i2c_verify_client(dev); 47 struct i2c_client *client = i2c_verify_client(dev);
48 struct alert_data *data = addrp; 48 struct alert_data *data = addrp;
49 struct i2c_driver *driver;
49 50
50 if (!client || client->addr != data->addr) 51 if (!client || client->addr != data->addr)
51 return 0; 52 return 0;
@@ -54,12 +55,13 @@ static int smbus_do_alert(struct device *dev, void *addrp)
54 55
55 /* 56 /*
56 * Drivers should either disable alerts, or provide at least 57 * Drivers should either disable alerts, or provide at least
57 * a minimal handler. Lock so client->driver won't change. 58 * a minimal handler. Lock so the driver won't change.
58 */ 59 */
59 device_lock(dev); 60 device_lock(dev);
60 if (client->driver) { 61 if (client->dev.driver) {
61 if (client->driver->alert) 62 driver = to_i2c_driver(client->dev.driver);
62 client->driver->alert(client, data->flag); 63 if (driver->alert)
64 driver->alert(client, data->flag);
63 else 65 else
64 dev_warn(&client->dev, "no driver alert()!\n"); 66 dev_warn(&client->dev, "no driver alert()!\n");
65 } else 67 } else