aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/regulator
diff options
context:
space:
mode:
authorWolfram Sang <w.sang@pengutronix.de>2010-06-03 05:33:58 -0400
committerJean Delvare <khali@linux-fr.org>2010-06-03 05:33:58 -0400
commitfbae3fb1546e199ab0cd185348f8124411a1ca9d (patch)
tree928881dc419348268cbc8208a41fe0d038035114 /drivers/regulator
parent35bfc353dcaecc99c277e3646564f3f785760bde (diff)
i2c: Remove all i2c_set_clientdata(client, NULL) in drivers
I2C drivers can use the clientdata-pointer to point to private data. As I2C devices are not really unregistered, but merely detached from their driver, it used to be the drivers obligation to clear this pointer during remove() or a failed probe(). As a couple of drivers forgot to do this, it was agreed that it was cleaner if the i2c-core does this clearance when appropriate, as there is no guarantee for the lifetime of the clientdata-pointer after remove() anyhow. This feature was added to the core with commit e4a7b9b04de15f6b63da5ccdd373ffa3057a3681 to fix the faulty drivers. As there is no need anymore to clear the clientdata-pointer, remove all current occurrences in the drivers to simplify the code and prevent confusion. Signed-off-by: Wolfram Sang <w.sang@pengutronix.de> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Greg Kroah-Hartman <gregkh@suse.de> Acked-by: Richard Purdie <rpurdie@linux.intel.com> Acked-by: Dmitry Torokhov <dtor@mail.ru> Signed-off-by: Jean Delvare <khali@linux-fr.org>
Diffstat (limited to 'drivers/regulator')
-rw-r--r--drivers/regulator/lp3971.c2
-rw-r--r--drivers/regulator/max1586.c1
-rw-r--r--drivers/regulator/max8649.c2
-rw-r--r--drivers/regulator/max8660.c1
-rw-r--r--drivers/regulator/tps65023-regulator.c3
5 files changed, 0 insertions, 9 deletions
diff --git a/drivers/regulator/lp3971.c b/drivers/regulator/lp3971.c
index 671a7d1f1f0e..8ae3732eb24b 100644
--- a/drivers/regulator/lp3971.c
+++ b/drivers/regulator/lp3971.c
@@ -519,8 +519,6 @@ static int __devexit lp3971_i2c_remove(struct i2c_client *i2c)
519 struct lp3971 *lp3971 = i2c_get_clientdata(i2c); 519 struct lp3971 *lp3971 = i2c_get_clientdata(i2c);
520 int i; 520 int i;
521 521
522 i2c_set_clientdata(i2c, NULL);
523
524 for (i = 0; i < lp3971->num_regulators; i++) 522 for (i = 0; i < lp3971->num_regulators; i++)
525 regulator_unregister(lp3971->rdev[i]); 523 regulator_unregister(lp3971->rdev[i]);
526 524
diff --git a/drivers/regulator/max1586.c b/drivers/regulator/max1586.c
index b3c1afc16889..2b54d9d75f11 100644
--- a/drivers/regulator/max1586.c
+++ b/drivers/regulator/max1586.c
@@ -244,7 +244,6 @@ static int __devexit max1586_pmic_remove(struct i2c_client *client)
244 for (i = 0; i <= MAX1586_V6; i++) 244 for (i = 0; i <= MAX1586_V6; i++)
245 if (rdev[i]) 245 if (rdev[i])
246 regulator_unregister(rdev[i]); 246 regulator_unregister(rdev[i]);
247 i2c_set_clientdata(client, NULL);
248 kfree(rdev); 247 kfree(rdev);
249 248
250 return 0; 249 return 0;
diff --git a/drivers/regulator/max8649.c b/drivers/regulator/max8649.c
index bfc4c5ffdc96..4520ace3f7e7 100644
--- a/drivers/regulator/max8649.c
+++ b/drivers/regulator/max8649.c
@@ -357,7 +357,6 @@ static int __devinit max8649_regulator_probe(struct i2c_client *client,
357 dev_info(info->dev, "Max8649 regulator device is detected.\n"); 357 dev_info(info->dev, "Max8649 regulator device is detected.\n");
358 return 0; 358 return 0;
359out: 359out:
360 i2c_set_clientdata(client, NULL);
361 kfree(info); 360 kfree(info);
362 return ret; 361 return ret;
363} 362}
@@ -369,7 +368,6 @@ static int __devexit max8649_regulator_remove(struct i2c_client *client)
369 if (info) { 368 if (info) {
370 if (info->regulator) 369 if (info->regulator)
371 regulator_unregister(info->regulator); 370 regulator_unregister(info->regulator);
372 i2c_set_clientdata(client, NULL);
373 kfree(info); 371 kfree(info);
374 } 372 }
375 373
diff --git a/drivers/regulator/max8660.c b/drivers/regulator/max8660.c
index 3790b21879ff..d97220efae5a 100644
--- a/drivers/regulator/max8660.c
+++ b/drivers/regulator/max8660.c
@@ -471,7 +471,6 @@ static int __devexit max8660_remove(struct i2c_client *client)
471 for (i = 0; i < MAX8660_V_END; i++) 471 for (i = 0; i < MAX8660_V_END; i++)
472 if (rdev[i]) 472 if (rdev[i])
473 regulator_unregister(rdev[i]); 473 regulator_unregister(rdev[i]);
474 i2c_set_clientdata(client, NULL);
475 kfree(rdev); 474 kfree(rdev);
476 475
477 return 0; 476 return 0;
diff --git a/drivers/regulator/tps65023-regulator.c b/drivers/regulator/tps65023-regulator.c
index 8e2f2098b005..f50afc9f287a 100644
--- a/drivers/regulator/tps65023-regulator.c
+++ b/drivers/regulator/tps65023-regulator.c
@@ -538,9 +538,6 @@ static int __devexit tps_65023_remove(struct i2c_client *client)
538 struct tps_pmic *tps = i2c_get_clientdata(client); 538 struct tps_pmic *tps = i2c_get_clientdata(client);
539 int i; 539 int i;
540 540
541 /* clear the client data in i2c */
542 i2c_set_clientdata(client, NULL);
543
544 for (i = 0; i < TPS65023_NUM_REGULATOR; i++) 541 for (i = 0; i < TPS65023_NUM_REGULATOR; i++)
545 regulator_unregister(tps->rdev[i]); 542 regulator_unregister(tps->rdev[i]);
546 543