Skip to content

Commit

Permalink
i2c: Fix device_init_wakeup place
Browse files Browse the repository at this point in the history
device_init_wakeup must be called after device_register.

Signed-off-by: Marc Pignat <[email protected]>
Acked-by: David Brownell <[email protected]>
Signed-off-by: Jean Delvare <[email protected]>
  • Loading branch information
RandomReaper authored and Jean Delvare committed Aug 28, 2008
1 parent 1941246 commit ee35425
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions drivers/i2c/i2c-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down Expand Up @@ -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;

Expand Down

0 comments on commit ee35425

Please sign in to comment.