diff options
author | Wolfram Sang <w.sang@pengutronix.de> | 2010-03-22 08:31:26 +0300 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2010-04-14 10:26:44 +0400 |
commit | a5b33e6a207d75120ad9dad0b5401b561991dcce (patch) | |
tree | 7fa3c4b3c4a03c232cb6fd1a8fe80c05265d62a8 /drivers/input/keyboard/lm8323.c | |
parent | d6372b706e83817dfa6c9326d1054b9b95a7de2a (diff) | |
download | linux-a5b33e6a207d75120ad9dad0b5401b561991dcce.tar.xz |
Input: lm8323 - do not leave dangling client data pointer
Do not leave dangling client data pointers when unbinding device from the
driver or when binding fails for some reason.
Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Diffstat (limited to 'drivers/input/keyboard/lm8323.c')
-rw-r--r-- | drivers/input/keyboard/lm8323.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/input/keyboard/lm8323.c b/drivers/input/keyboard/lm8323.c index 60ac4684f875..bc696931fed7 100644 --- a/drivers/input/keyboard/lm8323.c +++ b/drivers/input/keyboard/lm8323.c @@ -670,8 +670,6 @@ static int __devinit lm8323_probe(struct i2c_client *client, goto fail1; } - i2c_set_clientdata(client, lm); - lm->client = client; lm->idev = idev; mutex_init(&lm->lock); @@ -753,6 +751,8 @@ static int __devinit lm8323_probe(struct i2c_client *client, goto fail4; } + i2c_set_clientdata(client, lm); + device_init_wakeup(&client->dev, 1); enable_irq_wake(client->irq); @@ -778,6 +778,8 @@ static int __devexit lm8323_remove(struct i2c_client *client) struct lm8323_chip *lm = i2c_get_clientdata(client); int i; + i2c_set_clientdata(client, NULL); + disable_irq_wake(client->irq); free_irq(client->irq, lm); cancel_work_sync(&lm->work); |