diff options
author | Marc Pignat <marc.pignat@hevs.ch> | 2008-08-28 08:33:22 +0200 |
---|---|---|
committer | Jean Delvare <khali@mahadeva.delvare> | 2008-08-28 08:33:22 +0200 |
commit | ee35425c8eb11556a4cb7b1c7543f1bfb88f911c (patch) | |
tree | b288fd8c690fe98c4045e74ce53af1cd93ece826 /drivers/i2c/i2c-core.c | |
parent | Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiw... (diff) | |
download | linux-ee35425c8eb11556a4cb7b1c7543f1bfb88f911c.tar.xz linux-ee35425c8eb11556a4cb7b1c7543f1bfb88f911c.zip |
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/i2c-core.c')
-rw-r--r-- | drivers/i2c/i2c-core.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c index 550853f79ae8..4ac33670797f 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; |