diff options
author | Jean Delvare <khali@linux-fr.org> | 2008-04-29 17:11:38 -0400 |
---|---|---|
committer | Jean Delvare <khali@hyperion.delvare> | 2008-04-29 17:11:38 -0400 |
commit | 6d072d78f87e8fe0fe30d096991b83af07f8bdfe (patch) | |
tree | 5af6f58271aa711a2f8480f1e7449657ebc55204 /drivers/i2c/chips/tps65010.c | |
parent | 1842cc2eeb345c4eef069ffd46e95359fb37b4b5 (diff) |
i2c/tps65010: Add missing intialization of client data
tps65010_remove() calls i2c_get_clientdata(client) but the client data
is never set during initialization, so it gets a NULL pointer at best.
I guess it was never spotted because the tps65010 driver is typically
not built modular so this function is discarded.
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Cc: David Brownell <dbrownell@users.sourceforge.net>
Diffstat (limited to 'drivers/i2c/chips/tps65010.c')
-rw-r--r-- | drivers/i2c/chips/tps65010.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/i2c/chips/tps65010.c b/drivers/i2c/chips/tps65010.c index b67f69c2e7f3..feabd12c081c 100644 --- a/drivers/i2c/chips/tps65010.c +++ b/drivers/i2c/chips/tps65010.c | |||
@@ -527,6 +527,7 @@ static int __exit tps65010_remove(struct i2c_client *client) | |||
527 | flush_scheduled_work(); | 527 | flush_scheduled_work(); |
528 | debugfs_remove(tps->file); | 528 | debugfs_remove(tps->file); |
529 | kfree(tps); | 529 | kfree(tps); |
530 | i2c_set_clientdata(client, NULL); | ||
530 | the_tps = NULL; | 531 | the_tps = NULL; |
531 | return 0; | 532 | return 0; |
532 | } | 533 | } |
@@ -615,6 +616,7 @@ static int tps65010_probe(struct i2c_client *client) | |||
615 | i2c_smbus_read_byte_data(client, TPS_DEFGPIO), | 616 | i2c_smbus_read_byte_data(client, TPS_DEFGPIO), |
616 | i2c_smbus_read_byte_data(client, TPS_MASK3)); | 617 | i2c_smbus_read_byte_data(client, TPS_MASK3)); |
617 | 618 | ||
619 | i2c_set_clientdata(client, tps); | ||
618 | the_tps = tps; | 620 | the_tps = tps; |
619 | 621 | ||
620 | #if defined(CONFIG_USB_GADGET) && !defined(CONFIG_USB_OTG) | 622 | #if defined(CONFIG_USB_GADGET) && !defined(CONFIG_USB_OTG) |