i2c: Fix device_init_wakeup place
device_init_wakeup must be called after device_register. Signed-off-by: Marc Pignat <marc.pignat@hevs.ch> Acked-by: David Brownell <david-b@pacbell.net> Signed-off-by: Jean Delvare <khali@linux-fr.org>
This commit is contained in:
Родитель
1941246dd9
Коммит
ee35425c8e
|
@ -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)
|
||||||
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;
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче