aboutsummaryrefslogtreecommitdiff
path: root/drivers/i2c
diff options
context:
space:
mode:
authorMarc Pignat <marc.pignat@hevs.ch>2008-08-28 08:33:22 +0200
committerJean Delvare <khali@mahadeva.delvare>2008-08-28 08:33:22 +0200
commitee35425c8eb11556a4cb7b1c7543f1bfb88f911c (patch)
treeb288fd8c690fe98c4045e74ce53af1cd93ece826 /drivers/i2c
parent1941246dd98089dd637f44d3bd4f6cc1c61aa9e4 (diff)
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>
Diffstat (limited to 'drivers/i2c')
-rw-r--r--drivers/i2c/i2c-core.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c
index 550853f79ae..4ac33670797 100644
--- a/drivers/i2c/i2c-core.c
+++ b/drivers/i2c/i2c-core.c
@@ -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;