Commit ee35425c authored by Marc Pignat's avatar Marc Pignat Committed by Jean Delvare

i2c: Fix device_init_wakeup place

device_init_wakeup must be called after device_register.
Signed-off-by: default avatarMarc Pignat <marc.pignat@hevs.ch>
Acked-by: default avatarDavid Brownell <david-b@pacbell.net>
Signed-off-by: default avatarJean Delvare <khali@linux-fr.org>
parent 1941246d
...@@ -108,6 +108,9 @@ static int i2c_device_probe(struct device *dev) ...@@ -108,6 +108,9 @@ static int i2c_device_probe(struct device *dev)
if (!driver->probe || !driver->id_table) if (!driver->probe || !driver->id_table)
return -ENODEV; return -ENODEV;
client->driver = driver; client->driver = driver;
if (!device_can_wakeup(&client->dev))
device_init_wakeup(&client->dev,
client->flags & I2C_CLIENT_WAKE);
dev_dbg(dev, "probe\n"); dev_dbg(dev, "probe\n");
status = driver->probe(client, i2c_match_id(driver->id_table, client)); status = driver->probe(client, i2c_match_id(driver->id_table, client));
...@@ -262,9 +265,8 @@ i2c_new_device(struct i2c_adapter *adap, struct i2c_board_info const *info) ...@@ -262,9 +265,8 @@ i2c_new_device(struct i2c_adapter *adap, struct i2c_board_info const *info)
client->adapter = adap; client->adapter = adap;
client->dev.platform_data = info->platform_data; client->dev.platform_data = info->platform_data;
device_init_wakeup(&client->dev, info->flags & I2C_CLIENT_WAKE);
client->flags = info->flags & ~I2C_CLIENT_WAKE; client->flags = info->flags;
client->addr = info->addr; client->addr = info->addr;
client->irq = info->irq; client->irq = info->irq;
......
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