提交 ee35425c 编写于 作者: M Marc Pignat 提交者: Jean Delvare

i2c: Fix device_init_wakeup place

device_init_wakeup must be called after device_register.
Signed-off-by: NMarc Pignat <marc.pignat@hevs.ch>
Acked-by: NDavid Brownell <david-b@pacbell.net>
Signed-off-by: NJean Delvare <khali@linux-fr.org>
上级 1941246d
......@@ -108,6 +108,9 @@ static int i2c_device_probe(struct device *dev)
if (!driver->probe || !driver->id_table)
return -ENODEV;
client->driver = driver;
if (!device_can_wakeup(&client->dev))
device_init_wakeup(&client->dev,
client->flags & I2C_CLIENT_WAKE);
dev_dbg(dev, "probe\n");
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->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->irq = info->irq;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册