diff options
author | Wolfram Sang <w.sang@pengutronix.de> | 2010-06-03 05:33:58 -0400 |
---|---|---|
committer | Jean Delvare <khali@linux-fr.org> | 2010-06-03 05:33:58 -0400 |
commit | fbae3fb1546e199ab0cd185348f8124411a1ca9d (patch) | |
tree | 928881dc419348268cbc8208a41fe0d038035114 | |
parent | 35bfc353dcaecc99c277e3646564f3f785760bde (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>
75 files changed, 4 insertions, 141 deletions
diff --git a/drivers/hwmon/adt7411.c b/drivers/hwmon/adt7411.c index 4086c7257f9..f13c843a296 100644 --- a/drivers/hwmon/adt7411.c +++ b/drivers/hwmon/adt7411.c | |||
@@ -316,7 +316,6 @@ static int __devinit adt7411_probe(struct i2c_client *client, | |||
316 | exit_remove: | 316 | exit_remove: |
317 | sysfs_remove_group(&client->dev.kobj, &adt7411_attr_grp); | 317 | sysfs_remove_group(&client->dev.kobj, &adt7411_attr_grp); |
318 | exit_free: | 318 | exit_free: |
319 | i2c_set_clientdata(client, NULL); | ||
320 | kfree(data); | 319 | kfree(data); |
321 | return ret; | 320 | return ret; |
322 | } | 321 | } |
@@ -327,7 +326,6 @@ static int __devexit adt7411_remove(struct i2c_client *client) | |||
327 | 326 | ||
328 | hwmon_device_unregister(data->hwmon_dev); | 327 | hwmon_device_unregister(data->hwmon_dev); |
329 | sysfs_remove_group(&client->dev.kobj, &adt7411_attr_grp); | 328 | sysfs_remove_group(&client->dev.kobj, &adt7411_attr_grp); |
330 | i2c_set_clientdata(client, NULL); | ||
331 | kfree(data); | 329 | kfree(data); |
332 | return 0; | 330 | return 0; |
333 | } | 331 | } |
diff --git a/drivers/hwmon/asc7621.c b/drivers/hwmon/asc7621.c index 0f388adc618..3b973f30b1f 100644 --- a/drivers/hwmon/asc7621.c +++ b/drivers/hwmon/asc7621.c | |||
@@ -1141,7 +1141,6 @@ exit_remove: | |||
1141 | &(asc7621_params[i].sda.dev_attr)); | 1141 | &(asc7621_params[i].sda.dev_attr)); |
1142 | } | 1142 | } |
1143 | 1143 | ||
1144 | i2c_set_clientdata(client, NULL); | ||
1145 | kfree(data); | 1144 | kfree(data); |
1146 | return err; | 1145 | return err; |
1147 | } | 1146 | } |
@@ -1196,7 +1195,6 @@ static int asc7621_remove(struct i2c_client *client) | |||
1196 | &(asc7621_params[i].sda.dev_attr)); | 1195 | &(asc7621_params[i].sda.dev_attr)); |
1197 | } | 1196 | } |
1198 | 1197 | ||
1199 | i2c_set_clientdata(client, NULL); | ||
1200 | kfree(data); | 1198 | kfree(data); |
1201 | return 0; | 1199 | return 0; |
1202 | } | 1200 | } |
diff --git a/drivers/hwmon/f75375s.c b/drivers/hwmon/f75375s.c index bad2cf3ef4a..0f58ecc5334 100644 --- a/drivers/hwmon/f75375s.c +++ b/drivers/hwmon/f75375s.c | |||
@@ -662,7 +662,6 @@ exit_remove: | |||
662 | sysfs_remove_group(&client->dev.kobj, &f75375_group); | 662 | sysfs_remove_group(&client->dev.kobj, &f75375_group); |
663 | exit_free: | 663 | exit_free: |
664 | kfree(data); | 664 | kfree(data); |
665 | i2c_set_clientdata(client, NULL); | ||
666 | return err; | 665 | return err; |
667 | } | 666 | } |
668 | 667 | ||
@@ -672,7 +671,6 @@ static int f75375_remove(struct i2c_client *client) | |||
672 | hwmon_device_unregister(data->hwmon_dev); | 671 | hwmon_device_unregister(data->hwmon_dev); |
673 | sysfs_remove_group(&client->dev.kobj, &f75375_group); | 672 | sysfs_remove_group(&client->dev.kobj, &f75375_group); |
674 | kfree(data); | 673 | kfree(data); |
675 | i2c_set_clientdata(client, NULL); | ||
676 | return 0; | 674 | return 0; |
677 | } | 675 | } |
678 | 676 | ||
diff --git a/drivers/hwmon/g760a.c b/drivers/hwmon/g760a.c index 09ea12e0a55..1f63d1a3af5 100644 --- a/drivers/hwmon/g760a.c +++ b/drivers/hwmon/g760a.c | |||
@@ -236,7 +236,6 @@ error_hwmon_device_register: | |||
236 | sysfs_remove_group(&client->dev.kobj, &g760a_group); | 236 | sysfs_remove_group(&client->dev.kobj, &g760a_group); |
237 | error_sysfs_create_group: | 237 | error_sysfs_create_group: |
238 | kfree(data); | 238 | kfree(data); |
239 | i2c_set_clientdata(client, NULL); | ||
240 | 239 | ||
241 | return err; | 240 | return err; |
242 | } | 241 | } |
@@ -247,7 +246,6 @@ static int g760a_remove(struct i2c_client *client) | |||
247 | hwmon_device_unregister(data->hwmon_dev); | 246 | hwmon_device_unregister(data->hwmon_dev); |
248 | sysfs_remove_group(&client->dev.kobj, &g760a_group); | 247 | sysfs_remove_group(&client->dev.kobj, &g760a_group); |
249 | kfree(data); | 248 | kfree(data); |
250 | i2c_set_clientdata(client, NULL); | ||
251 | 249 | ||
252 | return 0; | 250 | return 0; |
253 | } | 251 | } |
diff --git a/drivers/hwmon/lm73.c b/drivers/hwmon/lm73.c index 4d1b76bc814..29b9030d42c 100644 --- a/drivers/hwmon/lm73.c +++ b/drivers/hwmon/lm73.c | |||
@@ -136,7 +136,6 @@ static int lm73_remove(struct i2c_client *client) | |||
136 | 136 | ||
137 | hwmon_device_unregister(hwmon_dev); | 137 | hwmon_device_unregister(hwmon_dev); |
138 | sysfs_remove_group(&client->dev.kobj, &lm73_group); | 138 | sysfs_remove_group(&client->dev.kobj, &lm73_group); |
139 | i2c_set_clientdata(client, NULL); | ||
140 | return 0; | 139 | return 0; |
141 | } | 140 | } |
142 | 141 | ||
diff --git a/drivers/hwmon/lm75.c b/drivers/hwmon/lm75.c index 56463428a41..393f354f92a 100644 --- a/drivers/hwmon/lm75.c +++ b/drivers/hwmon/lm75.c | |||
@@ -192,7 +192,6 @@ lm75_probe(struct i2c_client *client, const struct i2c_device_id *id) | |||
192 | exit_remove: | 192 | exit_remove: |
193 | sysfs_remove_group(&client->dev.kobj, &lm75_group); | 193 | sysfs_remove_group(&client->dev.kobj, &lm75_group); |
194 | exit_free: | 194 | exit_free: |
195 | i2c_set_clientdata(client, NULL); | ||
196 | kfree(data); | 195 | kfree(data); |
197 | return status; | 196 | return status; |
198 | } | 197 | } |
@@ -204,7 +203,6 @@ static int lm75_remove(struct i2c_client *client) | |||
204 | hwmon_device_unregister(data->hwmon_dev); | 203 | hwmon_device_unregister(data->hwmon_dev); |
205 | sysfs_remove_group(&client->dev.kobj, &lm75_group); | 204 | sysfs_remove_group(&client->dev.kobj, &lm75_group); |
206 | lm75_write_value(client, LM75_REG_CONF, data->orig_conf); | 205 | lm75_write_value(client, LM75_REG_CONF, data->orig_conf); |
207 | i2c_set_clientdata(client, NULL); | ||
208 | kfree(data); | 206 | kfree(data); |
209 | return 0; | 207 | return 0; |
210 | } | 208 | } |
diff --git a/drivers/hwmon/lm95241.c b/drivers/hwmon/lm95241.c index 8fc8eb8cba4..94741d42112 100644 --- a/drivers/hwmon/lm95241.c +++ b/drivers/hwmon/lm95241.c | |||
@@ -399,7 +399,6 @@ static int lm95241_remove(struct i2c_client *client) | |||
399 | hwmon_device_unregister(data->hwmon_dev); | 399 | hwmon_device_unregister(data->hwmon_dev); |
400 | sysfs_remove_group(&client->dev.kobj, &lm95241_group); | 400 | sysfs_remove_group(&client->dev.kobj, &lm95241_group); |
401 | 401 | ||
402 | i2c_set_clientdata(client, NULL); | ||
403 | kfree(data); | 402 | kfree(data); |
404 | return 0; | 403 | return 0; |
405 | } | 404 | } |
diff --git a/drivers/hwmon/tmp102.c b/drivers/hwmon/tmp102.c index 8013895a1fa..93187c3cb5e 100644 --- a/drivers/hwmon/tmp102.c +++ b/drivers/hwmon/tmp102.c | |||
@@ -224,7 +224,6 @@ fail_remove_sysfs: | |||
224 | fail_restore_config: | 224 | fail_restore_config: |
225 | tmp102_write_reg(client, TMP102_CONF_REG, tmp102->config_orig); | 225 | tmp102_write_reg(client, TMP102_CONF_REG, tmp102->config_orig); |
226 | fail_free: | 226 | fail_free: |
227 | i2c_set_clientdata(client, NULL); | ||
228 | kfree(tmp102); | 227 | kfree(tmp102); |
229 | 228 | ||
230 | return status; | 229 | return status; |
@@ -247,7 +246,6 @@ static int __devexit tmp102_remove(struct i2c_client *client) | |||
247 | config | TMP102_CONF_SD); | 246 | config | TMP102_CONF_SD); |
248 | } | 247 | } |
249 | 248 | ||
250 | i2c_set_clientdata(client, NULL); | ||
251 | kfree(tmp102); | 249 | kfree(tmp102); |
252 | 250 | ||
253 | return 0; | 251 | return 0; |
diff --git a/drivers/hwmon/tmp421.c b/drivers/hwmon/tmp421.c index 738c472ece2..6b4165c1209 100644 --- a/drivers/hwmon/tmp421.c +++ b/drivers/hwmon/tmp421.c | |||
@@ -295,7 +295,6 @@ exit_remove: | |||
295 | sysfs_remove_group(&client->dev.kobj, &tmp421_group); | 295 | sysfs_remove_group(&client->dev.kobj, &tmp421_group); |
296 | 296 | ||
297 | exit_free: | 297 | exit_free: |
298 | i2c_set_clientdata(client, NULL); | ||
299 | kfree(data); | 298 | kfree(data); |
300 | 299 | ||
301 | return err; | 300 | return err; |
@@ -308,7 +307,6 @@ static int tmp421_remove(struct i2c_client *client) | |||
308 | hwmon_device_unregister(data->hwmon_dev); | 307 | hwmon_device_unregister(data->hwmon_dev); |
309 | sysfs_remove_group(&client->dev.kobj, &tmp421_group); | 308 | sysfs_remove_group(&client->dev.kobj, &tmp421_group); |
310 | 309 | ||
311 | i2c_set_clientdata(client, NULL); | ||
312 | kfree(data); | 310 | kfree(data); |
313 | 311 | ||
314 | return 0; | 312 | return 0; |
diff --git a/drivers/hwmon/w83781d.c b/drivers/hwmon/w83781d.c index 32d4adee73d..c84b9b4e696 100644 --- a/drivers/hwmon/w83781d.c +++ b/drivers/hwmon/w83781d.c | |||
@@ -1197,7 +1197,6 @@ ERROR4: | |||
1197 | if (data->lm75[1]) | 1197 | if (data->lm75[1]) |
1198 | i2c_unregister_device(data->lm75[1]); | 1198 | i2c_unregister_device(data->lm75[1]); |
1199 | ERROR3: | 1199 | ERROR3: |
1200 | i2c_set_clientdata(client, NULL); | ||
1201 | kfree(data); | 1200 | kfree(data); |
1202 | ERROR1: | 1201 | ERROR1: |
1203 | return err; | 1202 | return err; |
@@ -1219,7 +1218,6 @@ w83781d_remove(struct i2c_client *client) | |||
1219 | if (data->lm75[1]) | 1218 | if (data->lm75[1]) |
1220 | i2c_unregister_device(data->lm75[1]); | 1219 | i2c_unregister_device(data->lm75[1]); |
1221 | 1220 | ||
1222 | i2c_set_clientdata(client, NULL); | ||
1223 | kfree(data); | 1221 | kfree(data); |
1224 | 1222 | ||
1225 | return 0; | 1223 | return 0; |
diff --git a/drivers/i2c/i2c-smbus.c b/drivers/i2c/i2c-smbus.c index a24e0bfe920..f61ccc1e5ea 100644 --- a/drivers/i2c/i2c-smbus.c +++ b/drivers/i2c/i2c-smbus.c | |||
@@ -173,7 +173,6 @@ static int smbalert_remove(struct i2c_client *ara) | |||
173 | 173 | ||
174 | cancel_work_sync(&alert->alert); | 174 | cancel_work_sync(&alert->alert); |
175 | 175 | ||
176 | i2c_set_clientdata(ara, NULL); | ||
177 | kfree(alert); | 176 | kfree(alert); |
178 | return 0; | 177 | return 0; |
179 | } | 178 | } |
diff --git a/drivers/input/keyboard/adp5588-keys.c b/drivers/input/keyboard/adp5588-keys.c index 4771ab172b5..744600eff22 100644 --- a/drivers/input/keyboard/adp5588-keys.c +++ b/drivers/input/keyboard/adp5588-keys.c | |||
@@ -287,7 +287,6 @@ static int __devexit adp5588_remove(struct i2c_client *client) | |||
287 | free_irq(client->irq, kpad); | 287 | free_irq(client->irq, kpad); |
288 | cancel_delayed_work_sync(&kpad->work); | 288 | cancel_delayed_work_sync(&kpad->work); |
289 | input_unregister_device(kpad->input); | 289 | input_unregister_device(kpad->input); |
290 | i2c_set_clientdata(client, NULL); | ||
291 | kfree(kpad); | 290 | kfree(kpad); |
292 | 291 | ||
293 | return 0; | 292 | return 0; |
diff --git a/drivers/input/keyboard/lm8323.c b/drivers/input/keyboard/lm8323.c index bc696931fed..40b032f0e32 100644 --- a/drivers/input/keyboard/lm8323.c +++ b/drivers/input/keyboard/lm8323.c | |||
@@ -778,8 +778,6 @@ static int __devexit lm8323_remove(struct i2c_client *client) | |||
778 | struct lm8323_chip *lm = i2c_get_clientdata(client); | 778 | struct lm8323_chip *lm = i2c_get_clientdata(client); |
779 | int i; | 779 | int i; |
780 | 780 | ||
781 | i2c_set_clientdata(client, NULL); | ||
782 | |||
783 | disable_irq_wake(client->irq); | 781 | disable_irq_wake(client->irq); |
784 | free_irq(client->irq, lm); | 782 | free_irq(client->irq, lm); |
785 | cancel_work_sync(&lm->work); | 783 | cancel_work_sync(&lm->work); |
diff --git a/drivers/input/keyboard/max7359_keypad.c b/drivers/input/keyboard/max7359_keypad.c index 7fc8185e5c1..9091ff5ea80 100644 --- a/drivers/input/keyboard/max7359_keypad.c +++ b/drivers/input/keyboard/max7359_keypad.c | |||
@@ -265,7 +265,6 @@ static int __devexit max7359_remove(struct i2c_client *client) | |||
265 | 265 | ||
266 | free_irq(client->irq, keypad); | 266 | free_irq(client->irq, keypad); |
267 | input_unregister_device(keypad->input_dev); | 267 | input_unregister_device(keypad->input_dev); |
268 | i2c_set_clientdata(client, NULL); | ||
269 | kfree(keypad); | 268 | kfree(keypad); |
270 | 269 | ||
271 | return 0; | 270 | return 0; |
diff --git a/drivers/input/keyboard/qt2160.c b/drivers/input/keyboard/qt2160.c index 31f30087b59..fac695157e8 100644 --- a/drivers/input/keyboard/qt2160.c +++ b/drivers/input/keyboard/qt2160.c | |||
@@ -358,7 +358,6 @@ static int __devexit qt2160_remove(struct i2c_client *client) | |||
358 | input_unregister_device(qt2160->input); | 358 | input_unregister_device(qt2160->input); |
359 | kfree(qt2160); | 359 | kfree(qt2160); |
360 | 360 | ||
361 | i2c_set_clientdata(client, NULL); | ||
362 | return 0; | 361 | return 0; |
363 | } | 362 | } |
364 | 363 | ||
diff --git a/drivers/input/keyboard/tca6416-keypad.c b/drivers/input/keyboard/tca6416-keypad.c index 493c93f25e2..00137bebcf9 100644 --- a/drivers/input/keyboard/tca6416-keypad.c +++ b/drivers/input/keyboard/tca6416-keypad.c | |||
@@ -316,8 +316,6 @@ static int __devexit tca6416_keypad_remove(struct i2c_client *client) | |||
316 | input_unregister_device(chip->input); | 316 | input_unregister_device(chip->input); |
317 | kfree(chip); | 317 | kfree(chip); |
318 | 318 | ||
319 | i2c_set_clientdata(client, NULL); | ||
320 | |||
321 | return 0; | 319 | return 0; |
322 | } | 320 | } |
323 | 321 | ||
diff --git a/drivers/input/misc/ad714x-i2c.c b/drivers/input/misc/ad714x-i2c.c index e9adbe49f6a..2bef8fa56c9 100644 --- a/drivers/input/misc/ad714x-i2c.c +++ b/drivers/input/misc/ad714x-i2c.c | |||
@@ -97,7 +97,6 @@ static int __devexit ad714x_i2c_remove(struct i2c_client *client) | |||
97 | struct ad714x_chip *chip = i2c_get_clientdata(client); | 97 | struct ad714x_chip *chip = i2c_get_clientdata(client); |
98 | 98 | ||
99 | ad714x_remove(chip); | 99 | ad714x_remove(chip); |
100 | i2c_set_clientdata(client, NULL); | ||
101 | 100 | ||
102 | return 0; | 101 | return 0; |
103 | } | 102 | } |
diff --git a/drivers/input/misc/pcf8574_keypad.c b/drivers/input/misc/pcf8574_keypad.c index 5c3ac4e0b05..0ac47d2898e 100644 --- a/drivers/input/misc/pcf8574_keypad.c +++ b/drivers/input/misc/pcf8574_keypad.c | |||
@@ -168,8 +168,6 @@ static int __devexit pcf8574_kp_remove(struct i2c_client *client) | |||
168 | input_unregister_device(lp->idev); | 168 | input_unregister_device(lp->idev); |
169 | kfree(lp); | 169 | kfree(lp); |
170 | 170 | ||
171 | i2c_set_clientdata(client, NULL); | ||
172 | |||
173 | return 0; | 171 | return 0; |
174 | } | 172 | } |
175 | 173 | ||
diff --git a/drivers/input/mouse/synaptics_i2c.c b/drivers/input/mouse/synaptics_i2c.c index 8291e7399ff..0ae62f0bcb3 100644 --- a/drivers/input/mouse/synaptics_i2c.c +++ b/drivers/input/mouse/synaptics_i2c.c | |||
@@ -613,7 +613,6 @@ static int __devexit synaptics_i2c_remove(struct i2c_client *client) | |||
613 | free_irq(client->irq, touch); | 613 | free_irq(client->irq, touch); |
614 | 614 | ||
615 | input_unregister_device(touch->input); | 615 | input_unregister_device(touch->input); |
616 | i2c_set_clientdata(client, NULL); | ||
617 | kfree(touch); | 616 | kfree(touch); |
618 | 617 | ||
619 | return 0; | 618 | return 0; |
diff --git a/drivers/input/touchscreen/ad7879.c b/drivers/input/touchscreen/ad7879.c index 794d070c690..4b32fb4704c 100644 --- a/drivers/input/touchscreen/ad7879.c +++ b/drivers/input/touchscreen/ad7879.c | |||
@@ -812,10 +812,8 @@ static int __devinit ad7879_probe(struct i2c_client *client, | |||
812 | ts->bus = client; | 812 | ts->bus = client; |
813 | 813 | ||
814 | error = ad7879_construct(client, ts); | 814 | error = ad7879_construct(client, ts); |
815 | if (error) { | 815 | if (error) |
816 | i2c_set_clientdata(client, NULL); | ||
817 | kfree(ts); | 816 | kfree(ts); |
818 | } | ||
819 | 817 | ||
820 | return error; | 818 | return error; |
821 | } | 819 | } |
@@ -825,7 +823,6 @@ static int __devexit ad7879_remove(struct i2c_client *client) | |||
825 | struct ad7879 *ts = dev_get_drvdata(&client->dev); | 823 | struct ad7879 *ts = dev_get_drvdata(&client->dev); |
826 | 824 | ||
827 | ad7879_destroy(client, ts); | 825 | ad7879_destroy(client, ts); |
828 | i2c_set_clientdata(client, NULL); | ||
829 | kfree(ts); | 826 | kfree(ts); |
830 | 827 | ||
831 | return 0; | 828 | return 0; |
diff --git a/drivers/input/touchscreen/eeti_ts.c b/drivers/input/touchscreen/eeti_ts.c index 75f8b73010f..7a3a916f84a 100644 --- a/drivers/input/touchscreen/eeti_ts.c +++ b/drivers/input/touchscreen/eeti_ts.c | |||
@@ -238,7 +238,6 @@ err2: | |||
238 | input = NULL; /* so we dont try to free it below */ | 238 | input = NULL; /* so we dont try to free it below */ |
239 | err1: | 239 | err1: |
240 | input_free_device(input); | 240 | input_free_device(input); |
241 | i2c_set_clientdata(client, NULL); | ||
242 | kfree(priv); | 241 | kfree(priv); |
243 | err0: | 242 | err0: |
244 | return err; | 243 | return err; |
@@ -256,7 +255,6 @@ static int __devexit eeti_ts_remove(struct i2c_client *client) | |||
256 | enable_irq(priv->irq); | 255 | enable_irq(priv->irq); |
257 | 256 | ||
258 | input_unregister_device(priv->input); | 257 | input_unregister_device(priv->input); |
259 | i2c_set_clientdata(client, NULL); | ||
260 | kfree(priv); | 258 | kfree(priv); |
261 | 259 | ||
262 | return 0; | 260 | return 0; |
diff --git a/drivers/input/touchscreen/mcs5000_ts.c b/drivers/input/touchscreen/mcs5000_ts.c index ce8ab0269f6..1fb0c2f06a4 100644 --- a/drivers/input/touchscreen/mcs5000_ts.c +++ b/drivers/input/touchscreen/mcs5000_ts.c | |||
@@ -256,7 +256,6 @@ static int __devexit mcs5000_ts_remove(struct i2c_client *client) | |||
256 | free_irq(client->irq, data); | 256 | free_irq(client->irq, data); |
257 | input_unregister_device(data->input_dev); | 257 | input_unregister_device(data->input_dev); |
258 | kfree(data); | 258 | kfree(data); |
259 | i2c_set_clientdata(client, NULL); | ||
260 | 259 | ||
261 | return 0; | 260 | return 0; |
262 | } | 261 | } |
diff --git a/drivers/input/touchscreen/tsc2007.c b/drivers/input/touchscreen/tsc2007.c index 769b479fcaa..be23780e8a3 100644 --- a/drivers/input/touchscreen/tsc2007.c +++ b/drivers/input/touchscreen/tsc2007.c | |||
@@ -347,8 +347,6 @@ static int __devexit tsc2007_remove(struct i2c_client *client) | |||
347 | struct tsc2007 *ts = i2c_get_clientdata(client); | 347 | struct tsc2007 *ts = i2c_get_clientdata(client); |
348 | struct tsc2007_platform_data *pdata = client->dev.platform_data; | 348 | struct tsc2007_platform_data *pdata = client->dev.platform_data; |
349 | 349 | ||
350 | i2c_set_clientdata(client, NULL); | ||
351 | |||
352 | tsc2007_free_irq(ts); | 350 | tsc2007_free_irq(ts); |
353 | 351 | ||
354 | if (pdata->exit_platform_hw) | 352 | if (pdata->exit_platform_hw) |
diff --git a/drivers/leds/leds-bd2802.c b/drivers/leds/leds-bd2802.c index 286b501a357..5dcdf9d69b3 100644 --- a/drivers/leds/leds-bd2802.c +++ b/drivers/leds/leds-bd2802.c | |||
@@ -742,7 +742,6 @@ failed_unregister_dev_file: | |||
742 | for (i--; i >= 0; i--) | 742 | for (i--; i >= 0; i--) |
743 | device_remove_file(&led->client->dev, bd2802_attributes[i]); | 743 | device_remove_file(&led->client->dev, bd2802_attributes[i]); |
744 | failed_free: | 744 | failed_free: |
745 | i2c_set_clientdata(client, NULL); | ||
746 | kfree(led); | 745 | kfree(led); |
747 | 746 | ||
748 | return ret; | 747 | return ret; |
@@ -759,7 +758,6 @@ static int __exit bd2802_remove(struct i2c_client *client) | |||
759 | bd2802_disable_adv_conf(led); | 758 | bd2802_disable_adv_conf(led); |
760 | for (i = 0; i < ARRAY_SIZE(bd2802_attributes); i++) | 759 | for (i = 0; i < ARRAY_SIZE(bd2802_attributes); i++) |
761 | device_remove_file(&led->client->dev, bd2802_attributes[i]); | 760 | device_remove_file(&led->client->dev, bd2802_attributes[i]); |
762 | i2c_set_clientdata(client, NULL); | ||
763 | kfree(led); | 761 | kfree(led); |
764 | 762 | ||
765 | return 0; | 763 | return 0; |
diff --git a/drivers/leds/leds-lp3944.c b/drivers/leds/leds-lp3944.c index 932a58da76c..9010c054615 100644 --- a/drivers/leds/leds-lp3944.c +++ b/drivers/leds/leds-lp3944.c | |||
@@ -432,7 +432,6 @@ static int __devexit lp3944_remove(struct i2c_client *client) | |||
432 | } | 432 | } |
433 | 433 | ||
434 | kfree(data); | 434 | kfree(data); |
435 | i2c_set_clientdata(client, NULL); | ||
436 | 435 | ||
437 | return 0; | 436 | return 0; |
438 | } | 437 | } |
diff --git a/drivers/leds/leds-pca9532.c b/drivers/leds/leds-pca9532.c index 6682175fa9f..43d08756d82 100644 --- a/drivers/leds/leds-pca9532.c +++ b/drivers/leds/leds-pca9532.c | |||
@@ -320,10 +320,8 @@ static int pca9532_probe(struct i2c_client *client, | |||
320 | mutex_init(&data->update_lock); | 320 | mutex_init(&data->update_lock); |
321 | 321 | ||
322 | err = pca9532_configure(client, data, pca9532_pdata); | 322 | err = pca9532_configure(client, data, pca9532_pdata); |
323 | if (err) { | 323 | if (err) |
324 | kfree(data); | 324 | kfree(data); |
325 | i2c_set_clientdata(client, NULL); | ||
326 | } | ||
327 | 325 | ||
328 | return err; | 326 | return err; |
329 | } | 327 | } |
@@ -351,7 +349,6 @@ static int pca9532_remove(struct i2c_client *client) | |||
351 | } | 349 | } |
352 | 350 | ||
353 | kfree(data); | 351 | kfree(data); |
354 | i2c_set_clientdata(client, NULL); | ||
355 | return 0; | 352 | return 0; |
356 | } | 353 | } |
357 | 354 | ||
diff --git a/drivers/leds/leds-pca955x.c b/drivers/leds/leds-pca955x.c index 8ff50f23419..66aa3e8e786 100644 --- a/drivers/leds/leds-pca955x.c +++ b/drivers/leds/leds-pca955x.c | |||
@@ -342,7 +342,6 @@ exit: | |||
342 | } | 342 | } |
343 | 343 | ||
344 | kfree(pca955x); | 344 | kfree(pca955x); |
345 | i2c_set_clientdata(client, NULL); | ||
346 | 345 | ||
347 | return err; | 346 | return err; |
348 | } | 347 | } |
@@ -358,7 +357,6 @@ static int __devexit pca955x_remove(struct i2c_client *client) | |||
358 | } | 357 | } |
359 | 358 | ||
360 | kfree(pca955x); | 359 | kfree(pca955x); |
361 | i2c_set_clientdata(client, NULL); | ||
362 | 360 | ||
363 | return 0; | 361 | return 0; |
364 | } | 362 | } |
diff --git a/drivers/macintosh/therm_adt746x.c b/drivers/macintosh/therm_adt746x.c index 16d82f17ae8..c42eeb43042 100644 --- a/drivers/macintosh/therm_adt746x.c +++ b/drivers/macintosh/therm_adt746x.c | |||
@@ -182,7 +182,6 @@ remove_thermostat(struct i2c_client *client) | |||
182 | 182 | ||
183 | thermostat = NULL; | 183 | thermostat = NULL; |
184 | 184 | ||
185 | i2c_set_clientdata(client, NULL); | ||
186 | kfree(th); | 185 | kfree(th); |
187 | 186 | ||
188 | return 0; | 187 | return 0; |
@@ -400,7 +399,6 @@ static int probe_thermostat(struct i2c_client *client, | |||
400 | rc = read_reg(th, CONFIG_REG); | 399 | rc = read_reg(th, CONFIG_REG); |
401 | if (rc < 0) { | 400 | if (rc < 0) { |
402 | dev_err(&client->dev, "Thermostat failed to read config!\n"); | 401 | dev_err(&client->dev, "Thermostat failed to read config!\n"); |
403 | i2c_set_clientdata(client, NULL); | ||
404 | kfree(th); | 402 | kfree(th); |
405 | return -ENODEV; | 403 | return -ENODEV; |
406 | } | 404 | } |
diff --git a/drivers/macintosh/windfarm_lm75_sensor.c b/drivers/macintosh/windfarm_lm75_sensor.c index d8257d35afd..647c6add219 100644 --- a/drivers/macintosh/windfarm_lm75_sensor.c +++ b/drivers/macintosh/windfarm_lm75_sensor.c | |||
@@ -107,10 +107,8 @@ static int wf_lm75_probe(struct i2c_client *client, | |||
107 | i2c_set_clientdata(client, lm); | 107 | i2c_set_clientdata(client, lm); |
108 | 108 | ||
109 | rc = wf_register_sensor(&lm->sens); | 109 | rc = wf_register_sensor(&lm->sens); |
110 | if (rc) { | 110 | if (rc) |
111 | i2c_set_clientdata(client, NULL); | ||
112 | kfree(lm); | 111 | kfree(lm); |
113 | } | ||
114 | 112 | ||
115 | return rc; | 113 | return rc; |
116 | } | 114 | } |
@@ -216,7 +214,6 @@ static int wf_lm75_remove(struct i2c_client *client) | |||
216 | /* release sensor */ | 214 | /* release sensor */ |
217 | wf_unregister_sensor(&lm->sens); | 215 | wf_unregister_sensor(&lm->sens); |
218 | 216 | ||
219 | i2c_set_clientdata(client, NULL); | ||
220 | return 0; | 217 | return 0; |
221 | } | 218 | } |
222 | 219 | ||
diff --git a/drivers/macintosh/windfarm_max6690_sensor.c b/drivers/macintosh/windfarm_max6690_sensor.c index b486eb929fd..8204113268f 100644 --- a/drivers/macintosh/windfarm_max6690_sensor.c +++ b/drivers/macintosh/windfarm_max6690_sensor.c | |||
@@ -81,7 +81,6 @@ static int wf_max6690_probe(struct i2c_client *client, | |||
81 | 81 | ||
82 | rc = wf_register_sensor(&max->sens); | 82 | rc = wf_register_sensor(&max->sens); |
83 | if (rc) { | 83 | if (rc) { |
84 | i2c_set_clientdata(client, NULL); | ||
85 | kfree(max); | 84 | kfree(max); |
86 | } | 85 | } |
87 | 86 | ||
diff --git a/drivers/macintosh/windfarm_smu_sat.c b/drivers/macintosh/windfarm_smu_sat.c index e20330a2895..65a8ff3e1f8 100644 --- a/drivers/macintosh/windfarm_smu_sat.c +++ b/drivers/macintosh/windfarm_smu_sat.c | |||
@@ -376,7 +376,6 @@ static int wf_sat_remove(struct i2c_client *client) | |||
376 | /* XXX TODO */ | 376 | /* XXX TODO */ |
377 | 377 | ||
378 | sat->i2c = NULL; | 378 | sat->i2c = NULL; |
379 | i2c_set_clientdata(client, NULL); | ||
380 | return 0; | 379 | return 0; |
381 | } | 380 | } |
382 | 381 | ||
diff --git a/drivers/media/radio/si470x/radio-si470x-i2c.c b/drivers/media/radio/si470x/radio-si470x-i2c.c index a5844d08d8b..67a4ec8768a 100644 --- a/drivers/media/radio/si470x/radio-si470x-i2c.c +++ b/drivers/media/radio/si470x/radio-si470x-i2c.c | |||
@@ -482,7 +482,6 @@ static __devexit int si470x_i2c_remove(struct i2c_client *client) | |||
482 | cancel_work_sync(&radio->radio_work); | 482 | cancel_work_sync(&radio->radio_work); |
483 | video_unregister_device(radio->videodev); | 483 | video_unregister_device(radio->videodev); |
484 | kfree(radio); | 484 | kfree(radio); |
485 | i2c_set_clientdata(client, NULL); | ||
486 | 485 | ||
487 | return 0; | 486 | return 0; |
488 | } | 487 | } |
diff --git a/drivers/media/video/mt9m001.c b/drivers/media/video/mt9m001.c index b62c0bd3f8e..e3b9a8ab37f 100644 --- a/drivers/media/video/mt9m001.c +++ b/drivers/media/video/mt9m001.c | |||
@@ -785,7 +785,6 @@ static int mt9m001_probe(struct i2c_client *client, | |||
785 | ret = mt9m001_video_probe(icd, client); | 785 | ret = mt9m001_video_probe(icd, client); |
786 | if (ret) { | 786 | if (ret) { |
787 | icd->ops = NULL; | 787 | icd->ops = NULL; |
788 | i2c_set_clientdata(client, NULL); | ||
789 | kfree(mt9m001); | 788 | kfree(mt9m001); |
790 | } | 789 | } |
791 | 790 | ||
@@ -799,7 +798,6 @@ static int mt9m001_remove(struct i2c_client *client) | |||
799 | 798 | ||
800 | icd->ops = NULL; | 799 | icd->ops = NULL; |
801 | mt9m001_video_remove(icd); | 800 | mt9m001_video_remove(icd); |
802 | i2c_set_clientdata(client, NULL); | ||
803 | client->driver = NULL; | 801 | client->driver = NULL; |
804 | kfree(mt9m001); | 802 | kfree(mt9m001); |
805 | 803 | ||
diff --git a/drivers/media/video/mt9m111.c b/drivers/media/video/mt9m111.c index d35f536f9fc..e42162c50f0 100644 --- a/drivers/media/video/mt9m111.c +++ b/drivers/media/video/mt9m111.c | |||
@@ -1068,7 +1068,6 @@ static int mt9m111_probe(struct i2c_client *client, | |||
1068 | ret = mt9m111_video_probe(icd, client); | 1068 | ret = mt9m111_video_probe(icd, client); |
1069 | if (ret) { | 1069 | if (ret) { |
1070 | icd->ops = NULL; | 1070 | icd->ops = NULL; |
1071 | i2c_set_clientdata(client, NULL); | ||
1072 | kfree(mt9m111); | 1071 | kfree(mt9m111); |
1073 | } | 1072 | } |
1074 | 1073 | ||
@@ -1081,7 +1080,6 @@ static int mt9m111_remove(struct i2c_client *client) | |||
1081 | struct soc_camera_device *icd = client->dev.platform_data; | 1080 | struct soc_camera_device *icd = client->dev.platform_data; |
1082 | 1081 | ||
1083 | icd->ops = NULL; | 1082 | icd->ops = NULL; |
1084 | i2c_set_clientdata(client, NULL); | ||
1085 | client->driver = NULL; | 1083 | client->driver = NULL; |
1086 | kfree(mt9m111); | 1084 | kfree(mt9m111); |
1087 | 1085 | ||
diff --git a/drivers/media/video/mt9t031.c b/drivers/media/video/mt9t031.c index 78b4e091d2d..9f5ff2547f1 100644 --- a/drivers/media/video/mt9t031.c +++ b/drivers/media/video/mt9t031.c | |||
@@ -883,7 +883,6 @@ static int mt9t031_probe(struct i2c_client *client, | |||
883 | if (ret) { | 883 | if (ret) { |
884 | if (icd) | 884 | if (icd) |
885 | icd->ops = NULL; | 885 | icd->ops = NULL; |
886 | i2c_set_clientdata(client, NULL); | ||
887 | kfree(mt9t031); | 886 | kfree(mt9t031); |
888 | } | 887 | } |
889 | 888 | ||
@@ -897,7 +896,6 @@ static int mt9t031_remove(struct i2c_client *client) | |||
897 | 896 | ||
898 | if (icd) | 897 | if (icd) |
899 | icd->ops = NULL; | 898 | icd->ops = NULL; |
900 | i2c_set_clientdata(client, NULL); | ||
901 | client->driver = NULL; | 899 | client->driver = NULL; |
902 | kfree(mt9t031); | 900 | kfree(mt9t031); |
903 | 901 | ||
diff --git a/drivers/media/video/mt9t112.c b/drivers/media/video/mt9t112.c index 7438f8d775b..aa4fce95098 100644 --- a/drivers/media/video/mt9t112.c +++ b/drivers/media/video/mt9t112.c | |||
@@ -1119,7 +1119,6 @@ static int mt9t112_probe(struct i2c_client *client, | |||
1119 | ret = mt9t112_camera_probe(icd, client); | 1119 | ret = mt9t112_camera_probe(icd, client); |
1120 | if (ret) { | 1120 | if (ret) { |
1121 | icd->ops = NULL; | 1121 | icd->ops = NULL; |
1122 | i2c_set_clientdata(client, NULL); | ||
1123 | kfree(priv); | 1122 | kfree(priv); |
1124 | } | 1123 | } |
1125 | 1124 | ||
@@ -1132,7 +1131,6 @@ static int mt9t112_remove(struct i2c_client *client) | |||
1132 | struct soc_camera_device *icd = client->dev.platform_data; | 1131 | struct soc_camera_device *icd = client->dev.platform_data; |
1133 | 1132 | ||
1134 | icd->ops = NULL; | 1133 | icd->ops = NULL; |
1135 | i2c_set_clientdata(client, NULL); | ||
1136 | kfree(priv); | 1134 | kfree(priv); |
1137 | return 0; | 1135 | return 0; |
1138 | } | 1136 | } |
diff --git a/drivers/media/video/mt9v022.c b/drivers/media/video/mt9v022.c index e5bae4c9393..fb44ff00662 100644 --- a/drivers/media/video/mt9v022.c +++ b/drivers/media/video/mt9v022.c | |||
@@ -920,7 +920,6 @@ static int mt9v022_probe(struct i2c_client *client, | |||
920 | ret = mt9v022_video_probe(icd, client); | 920 | ret = mt9v022_video_probe(icd, client); |
921 | if (ret) { | 921 | if (ret) { |
922 | icd->ops = NULL; | 922 | icd->ops = NULL; |
923 | i2c_set_clientdata(client, NULL); | ||
924 | kfree(mt9v022); | 923 | kfree(mt9v022); |
925 | } | 924 | } |
926 | 925 | ||
@@ -934,7 +933,6 @@ static int mt9v022_remove(struct i2c_client *client) | |||
934 | 933 | ||
935 | icd->ops = NULL; | 934 | icd->ops = NULL; |
936 | mt9v022_video_remove(icd); | 935 | mt9v022_video_remove(icd); |
937 | i2c_set_clientdata(client, NULL); | ||
938 | client->driver = NULL; | 936 | client->driver = NULL; |
939 | kfree(mt9v022); | 937 | kfree(mt9v022); |
940 | 938 | ||
diff --git a/drivers/media/video/ov772x.c b/drivers/media/video/ov772x.c index 7f8ece30c77..c33acc94b74 100644 --- a/drivers/media/video/ov772x.c +++ b/drivers/media/video/ov772x.c | |||
@@ -1159,7 +1159,6 @@ static int ov772x_probe(struct i2c_client *client, | |||
1159 | ret = ov772x_video_probe(icd, client); | 1159 | ret = ov772x_video_probe(icd, client); |
1160 | if (ret) { | 1160 | if (ret) { |
1161 | icd->ops = NULL; | 1161 | icd->ops = NULL; |
1162 | i2c_set_clientdata(client, NULL); | ||
1163 | kfree(priv); | 1162 | kfree(priv); |
1164 | } | 1163 | } |
1165 | 1164 | ||
@@ -1172,7 +1171,6 @@ static int ov772x_remove(struct i2c_client *client) | |||
1172 | struct soc_camera_device *icd = client->dev.platform_data; | 1171 | struct soc_camera_device *icd = client->dev.platform_data; |
1173 | 1172 | ||
1174 | icd->ops = NULL; | 1173 | icd->ops = NULL; |
1175 | i2c_set_clientdata(client, NULL); | ||
1176 | kfree(priv); | 1174 | kfree(priv); |
1177 | return 0; | 1175 | return 0; |
1178 | } | 1176 | } |
diff --git a/drivers/media/video/ov9640.c b/drivers/media/video/ov9640.c index 36599a65f54..035e9ecb0c7 100644 --- a/drivers/media/video/ov9640.c +++ b/drivers/media/video/ov9640.c | |||
@@ -783,7 +783,6 @@ static int ov9640_probe(struct i2c_client *client, | |||
783 | 783 | ||
784 | if (ret) { | 784 | if (ret) { |
785 | icd->ops = NULL; | 785 | icd->ops = NULL; |
786 | i2c_set_clientdata(client, NULL); | ||
787 | kfree(priv); | 786 | kfree(priv); |
788 | } | 787 | } |
789 | 788 | ||
@@ -794,7 +793,6 @@ static int ov9640_remove(struct i2c_client *client) | |||
794 | { | 793 | { |
795 | struct ov9640_priv *priv = i2c_get_clientdata(client); | 794 | struct ov9640_priv *priv = i2c_get_clientdata(client); |
796 | 795 | ||
797 | i2c_set_clientdata(client, NULL); | ||
798 | kfree(priv); | 796 | kfree(priv); |
799 | return 0; | 797 | return 0; |
800 | } | 798 | } |
diff --git a/drivers/media/video/rj54n1cb0c.c b/drivers/media/video/rj54n1cb0c.c index bbd9c11e2c5..2c3b58c99e1 100644 --- a/drivers/media/video/rj54n1cb0c.c +++ b/drivers/media/video/rj54n1cb0c.c | |||
@@ -1444,7 +1444,6 @@ static int rj54n1_probe(struct i2c_client *client, | |||
1444 | ret = rj54n1_video_probe(icd, client, rj54n1_priv); | 1444 | ret = rj54n1_video_probe(icd, client, rj54n1_priv); |
1445 | if (ret < 0) { | 1445 | if (ret < 0) { |
1446 | icd->ops = NULL; | 1446 | icd->ops = NULL; |
1447 | i2c_set_clientdata(client, NULL); | ||
1448 | kfree(rj54n1); | 1447 | kfree(rj54n1); |
1449 | return ret; | 1448 | return ret; |
1450 | } | 1449 | } |
@@ -1461,7 +1460,6 @@ static int rj54n1_remove(struct i2c_client *client) | |||
1461 | icd->ops = NULL; | 1460 | icd->ops = NULL; |
1462 | if (icl->free_bus) | 1461 | if (icl->free_bus) |
1463 | icl->free_bus(icl); | 1462 | icl->free_bus(icl); |
1464 | i2c_set_clientdata(client, NULL); | ||
1465 | client->driver = NULL; | 1463 | client->driver = NULL; |
1466 | kfree(rj54n1); | 1464 | kfree(rj54n1); |
1467 | 1465 | ||
diff --git a/drivers/media/video/tcm825x.c b/drivers/media/video/tcm825x.c index b90e9da3167..54681a53582 100644 --- a/drivers/media/video/tcm825x.c +++ b/drivers/media/video/tcm825x.c | |||
@@ -850,7 +850,6 @@ static int tcm825x_probe(struct i2c_client *client, | |||
850 | const struct i2c_device_id *did) | 850 | const struct i2c_device_id *did) |
851 | { | 851 | { |
852 | struct tcm825x_sensor *sensor = &tcm825x; | 852 | struct tcm825x_sensor *sensor = &tcm825x; |
853 | int rval; | ||
854 | 853 | ||
855 | if (i2c_get_clientdata(client)) | 854 | if (i2c_get_clientdata(client)) |
856 | return -EBUSY; | 855 | return -EBUSY; |
@@ -871,11 +870,7 @@ static int tcm825x_probe(struct i2c_client *client, | |||
871 | sensor->pix.height = tcm825x_sizes[QVGA].height; | 870 | sensor->pix.height = tcm825x_sizes[QVGA].height; |
872 | sensor->pix.pixelformat = V4L2_PIX_FMT_RGB565; | 871 | sensor->pix.pixelformat = V4L2_PIX_FMT_RGB565; |
873 | 872 | ||
874 | rval = v4l2_int_device_register(sensor->v4l2_int_device); | 873 | return v4l2_int_device_register(sensor->v4l2_int_device); |
875 | if (rval) | ||
876 | i2c_set_clientdata(client, NULL); | ||
877 | |||
878 | return rval; | ||
879 | } | 874 | } |
880 | 875 | ||
881 | static int tcm825x_remove(struct i2c_client *client) | 876 | static int tcm825x_remove(struct i2c_client *client) |
@@ -886,7 +881,6 @@ static int tcm825x_remove(struct i2c_client *client) | |||
886 | return -ENODEV; /* our client isn't attached */ | 881 | return -ENODEV; /* our client isn't attached */ |
887 | 882 | ||
888 | v4l2_int_device_unregister(sensor->v4l2_int_device); | 883 | v4l2_int_device_unregister(sensor->v4l2_int_device); |
889 | i2c_set_clientdata(client, NULL); | ||
890 | 884 | ||
891 | return 0; | 885 | return 0; |
892 | } | 886 | } |
diff --git a/drivers/media/video/tw9910.c b/drivers/media/video/tw9910.c index 76be733eabf..6eb3395def0 100644 --- a/drivers/media/video/tw9910.c +++ b/drivers/media/video/tw9910.c | |||
@@ -977,7 +977,6 @@ static int tw9910_probe(struct i2c_client *client, | |||
977 | ret = tw9910_video_probe(icd, client); | 977 | ret = tw9910_video_probe(icd, client); |
978 | if (ret) { | 978 | if (ret) { |
979 | icd->ops = NULL; | 979 | icd->ops = NULL; |
980 | i2c_set_clientdata(client, NULL); | ||
981 | kfree(priv); | 980 | kfree(priv); |
982 | } | 981 | } |
983 | 982 | ||
@@ -990,7 +989,6 @@ static int tw9910_remove(struct i2c_client *client) | |||
990 | struct soc_camera_device *icd = client->dev.platform_data; | 989 | struct soc_camera_device *icd = client->dev.platform_data; |
991 | 990 | ||
992 | icd->ops = NULL; | 991 | icd->ops = NULL; |
993 | i2c_set_clientdata(client, NULL); | ||
994 | kfree(priv); | 992 | kfree(priv); |
995 | return 0; | 993 | return 0; |
996 | } | 994 | } |
diff --git a/drivers/mfd/88pm860x-i2c.c b/drivers/mfd/88pm860x-i2c.c index c933b64d128..bc02e6b2160 100644 --- a/drivers/mfd/88pm860x-i2c.c +++ b/drivers/mfd/88pm860x-i2c.c | |||
@@ -200,8 +200,6 @@ static int __devexit pm860x_remove(struct i2c_client *client) | |||
200 | 200 | ||
201 | pm860x_device_exit(chip); | 201 | pm860x_device_exit(chip); |
202 | i2c_unregister_device(chip->companion); | 202 | i2c_unregister_device(chip->companion); |
203 | i2c_set_clientdata(chip->client, NULL); | ||
204 | i2c_set_clientdata(client, NULL); | ||
205 | kfree(chip); | 203 | kfree(chip); |
206 | return 0; | 204 | return 0; |
207 | } | 205 | } |
diff --git a/drivers/mfd/ab3100-core.c b/drivers/mfd/ab3100-core.c index 53ebfee548f..66379b41390 100644 --- a/drivers/mfd/ab3100-core.c +++ b/drivers/mfd/ab3100-core.c | |||
@@ -957,7 +957,6 @@ static int __init ab3100_probe(struct i2c_client *client, | |||
957 | i2c_unregister_device(ab3100->testreg_client); | 957 | i2c_unregister_device(ab3100->testreg_client); |
958 | exit_no_testreg_client: | 958 | exit_no_testreg_client: |
959 | exit_no_detect: | 959 | exit_no_detect: |
960 | i2c_set_clientdata(client, NULL); | ||
961 | kfree(ab3100); | 960 | kfree(ab3100); |
962 | return err; | 961 | return err; |
963 | } | 962 | } |
@@ -979,7 +978,6 @@ static int __exit ab3100_remove(struct i2c_client *client) | |||
979 | * their notifiers so deactivate IRQ | 978 | * their notifiers so deactivate IRQ |
980 | */ | 979 | */ |
981 | free_irq(client->irq, ab3100); | 980 | free_irq(client->irq, ab3100); |
982 | i2c_set_clientdata(client, NULL); | ||
983 | kfree(ab3100); | 981 | kfree(ab3100); |
984 | return 0; | 982 | return 0; |
985 | } | 983 | } |
diff --git a/drivers/mfd/ab3550-core.c b/drivers/mfd/ab3550-core.c index 1060f8e1c40..f54ab62e7bc 100644 --- a/drivers/mfd/ab3550-core.c +++ b/drivers/mfd/ab3550-core.c | |||
@@ -1362,7 +1362,6 @@ static int __exit ab3550_remove(struct i2c_client *client) | |||
1362 | * their notifiers so deactivate IRQ | 1362 | * their notifiers so deactivate IRQ |
1363 | */ | 1363 | */ |
1364 | free_irq(client->irq, ab); | 1364 | free_irq(client->irq, ab); |
1365 | i2c_set_clientdata(client, NULL); | ||
1366 | kfree(ab); | 1365 | kfree(ab); |
1367 | return 0; | 1366 | return 0; |
1368 | } | 1367 | } |
diff --git a/drivers/mfd/adp5520.c b/drivers/mfd/adp5520.c index 00553286565..3122139b430 100644 --- a/drivers/mfd/adp5520.c +++ b/drivers/mfd/adp5520.c | |||
@@ -302,7 +302,6 @@ out_free_irq: | |||
302 | free_irq(chip->irq, chip); | 302 | free_irq(chip->irq, chip); |
303 | 303 | ||
304 | out_free_chip: | 304 | out_free_chip: |
305 | i2c_set_clientdata(client, NULL); | ||
306 | kfree(chip); | 305 | kfree(chip); |
307 | 306 | ||
308 | return ret; | 307 | return ret; |
@@ -317,7 +316,6 @@ static int __devexit adp5520_remove(struct i2c_client *client) | |||
317 | 316 | ||
318 | adp5520_remove_subdevs(chip); | 317 | adp5520_remove_subdevs(chip); |
319 | adp5520_write(chip->dev, ADP5520_MODE_STATUS, 0); | 318 | adp5520_write(chip->dev, ADP5520_MODE_STATUS, 0); |
320 | i2c_set_clientdata(client, NULL); | ||
321 | kfree(chip); | 319 | kfree(chip); |
322 | return 0; | 320 | return 0; |
323 | } | 321 | } |
diff --git a/drivers/mfd/da903x.c b/drivers/mfd/da903x.c index 3ad915d0589..c07aece900f 100644 --- a/drivers/mfd/da903x.c +++ b/drivers/mfd/da903x.c | |||
@@ -534,7 +534,6 @@ static int __devinit da903x_probe(struct i2c_client *client, | |||
534 | out_free_irq: | 534 | out_free_irq: |
535 | free_irq(client->irq, chip); | 535 | free_irq(client->irq, chip); |
536 | out_free_chip: | 536 | out_free_chip: |
537 | i2c_set_clientdata(client, NULL); | ||
538 | kfree(chip); | 537 | kfree(chip); |
539 | return ret; | 538 | return ret; |
540 | } | 539 | } |
@@ -544,7 +543,6 @@ static int __devexit da903x_remove(struct i2c_client *client) | |||
544 | struct da903x_chip *chip = i2c_get_clientdata(client); | 543 | struct da903x_chip *chip = i2c_get_clientdata(client); |
545 | 544 | ||
546 | da903x_remove_subdevs(chip); | 545 | da903x_remove_subdevs(chip); |
547 | i2c_set_clientdata(client, NULL); | ||
548 | kfree(chip); | 546 | kfree(chip); |
549 | return 0; | 547 | return 0; |
550 | } | 548 | } |
diff --git a/drivers/mfd/max8925-i2c.c b/drivers/mfd/max8925-i2c.c index e73f3f5252a..0219115e00c 100644 --- a/drivers/mfd/max8925-i2c.c +++ b/drivers/mfd/max8925-i2c.c | |||
@@ -173,7 +173,6 @@ static int __devexit max8925_remove(struct i2c_client *client) | |||
173 | max8925_device_exit(chip); | 173 | max8925_device_exit(chip); |
174 | i2c_unregister_device(chip->adc); | 174 | i2c_unregister_device(chip->adc); |
175 | i2c_unregister_device(chip->rtc); | 175 | i2c_unregister_device(chip->rtc); |
176 | i2c_set_clientdata(chip->i2c, NULL); | ||
177 | kfree(chip); | 176 | kfree(chip); |
178 | return 0; | 177 | return 0; |
179 | } | 178 | } |
diff --git a/drivers/mfd/menelaus.c b/drivers/mfd/menelaus.c index 721948be12c..a3fb4bcb988 100644 --- a/drivers/mfd/menelaus.c +++ b/drivers/mfd/menelaus.c | |||
@@ -1228,7 +1228,6 @@ fail2: | |||
1228 | free_irq(client->irq, menelaus); | 1228 | free_irq(client->irq, menelaus); |
1229 | flush_scheduled_work(); | 1229 | flush_scheduled_work(); |
1230 | fail1: | 1230 | fail1: |
1231 | i2c_set_clientdata(client, NULL); | ||
1232 | kfree(menelaus); | 1231 | kfree(menelaus); |
1233 | return err; | 1232 | return err; |
1234 | } | 1233 | } |
@@ -1238,7 +1237,6 @@ static int __exit menelaus_remove(struct i2c_client *client) | |||
1238 | struct menelaus_chip *menelaus = i2c_get_clientdata(client); | 1237 | struct menelaus_chip *menelaus = i2c_get_clientdata(client); |
1239 | 1238 | ||
1240 | free_irq(client->irq, menelaus); | 1239 | free_irq(client->irq, menelaus); |
1241 | i2c_set_clientdata(client, NULL); | ||
1242 | kfree(menelaus); | 1240 | kfree(menelaus); |
1243 | the_menelaus = NULL; | 1241 | the_menelaus = NULL; |
1244 | return 0; | 1242 | return 0; |
diff --git a/drivers/mfd/pcf50633-core.c b/drivers/mfd/pcf50633-core.c index 704736e6e9b..23e58552728 100644 --- a/drivers/mfd/pcf50633-core.c +++ b/drivers/mfd/pcf50633-core.c | |||
@@ -336,7 +336,6 @@ static int __devinit pcf50633_probe(struct i2c_client *client, | |||
336 | return 0; | 336 | return 0; |
337 | 337 | ||
338 | err_free: | 338 | err_free: |
339 | i2c_set_clientdata(client, NULL); | ||
340 | kfree(pcf); | 339 | kfree(pcf); |
341 | 340 | ||
342 | return ret; | 341 | return ret; |
@@ -357,7 +356,6 @@ static int __devexit pcf50633_remove(struct i2c_client *client) | |||
357 | for (i = 0; i < PCF50633_NUM_REGULATORS; i++) | 356 | for (i = 0; i < PCF50633_NUM_REGULATORS; i++) |
358 | platform_device_unregister(pcf->regulator_pdev[i]); | 357 | platform_device_unregister(pcf->regulator_pdev[i]); |
359 | 358 | ||
360 | i2c_set_clientdata(client, NULL); | ||
361 | kfree(pcf); | 359 | kfree(pcf); |
362 | 360 | ||
363 | return 0; | 361 | return 0; |
diff --git a/drivers/mfd/tc35892.c b/drivers/mfd/tc35892.c index 715f095dd7a..e619e2a5599 100644 --- a/drivers/mfd/tc35892.c +++ b/drivers/mfd/tc35892.c | |||
@@ -296,7 +296,6 @@ out_freeirq: | |||
296 | out_removeirq: | 296 | out_removeirq: |
297 | tc35892_irq_remove(tc35892); | 297 | tc35892_irq_remove(tc35892); |
298 | out_free: | 298 | out_free: |
299 | i2c_set_clientdata(i2c, NULL); | ||
300 | kfree(tc35892); | 299 | kfree(tc35892); |
301 | return ret; | 300 | return ret; |
302 | } | 301 | } |
@@ -310,7 +309,6 @@ static int __devexit tc35892_remove(struct i2c_client *client) | |||
310 | free_irq(tc35892->i2c->irq, tc35892); | 309 | free_irq(tc35892->i2c->irq, tc35892); |
311 | tc35892_irq_remove(tc35892); | 310 | tc35892_irq_remove(tc35892); |
312 | 311 | ||
313 | i2c_set_clientdata(client, NULL); | ||
314 | kfree(tc35892); | 312 | kfree(tc35892); |
315 | 313 | ||
316 | return 0; | 314 | return 0; |
diff --git a/drivers/mfd/tps65010.c b/drivers/mfd/tps65010.c index 9b22a77f70f..d0016b67d12 100644 --- a/drivers/mfd/tps65010.c +++ b/drivers/mfd/tps65010.c | |||
@@ -530,7 +530,6 @@ static int __exit tps65010_remove(struct i2c_client *client) | |||
530 | cancel_delayed_work(&tps->work); | 530 | cancel_delayed_work(&tps->work); |
531 | flush_scheduled_work(); | 531 | flush_scheduled_work(); |
532 | debugfs_remove(tps->file); | 532 | debugfs_remove(tps->file); |
533 | i2c_set_clientdata(client, NULL); | ||
534 | kfree(tps); | 533 | kfree(tps); |
535 | the_tps = NULL; | 534 | the_tps = NULL; |
536 | return 0; | 535 | return 0; |
diff --git a/drivers/mfd/wm8350-i2c.c b/drivers/mfd/wm8350-i2c.c index 7795af4b1fe..5fe5de166ad 100644 --- a/drivers/mfd/wm8350-i2c.c +++ b/drivers/mfd/wm8350-i2c.c | |||
@@ -80,7 +80,6 @@ static int wm8350_i2c_probe(struct i2c_client *i2c, | |||
80 | return ret; | 80 | return ret; |
81 | 81 | ||
82 | err: | 82 | err: |
83 | i2c_set_clientdata(i2c, NULL); | ||
84 | kfree(wm8350); | 83 | kfree(wm8350); |
85 | return ret; | 84 | return ret; |
86 | } | 85 | } |
@@ -90,7 +89,6 @@ static int wm8350_i2c_remove(struct i2c_client *i2c) | |||
90 | struct wm8350 *wm8350 = i2c_get_clientdata(i2c); | 89 | struct wm8350 *wm8350 = i2c_get_clientdata(i2c); |
91 | 90 | ||
92 | wm8350_device_exit(wm8350); | 91 | wm8350_device_exit(wm8350); |
93 | i2c_set_clientdata(i2c, NULL); | ||
94 | kfree(wm8350); | 92 | kfree(wm8350); |
95 | 93 | ||
96 | return 0; | 94 | return 0; |
diff --git a/drivers/mfd/wm8400-core.c b/drivers/mfd/wm8400-core.c index e08aafa663d..1bfef4846b0 100644 --- a/drivers/mfd/wm8400-core.c +++ b/drivers/mfd/wm8400-core.c | |||
@@ -415,7 +415,6 @@ static int wm8400_i2c_probe(struct i2c_client *i2c, | |||
415 | return 0; | 415 | return 0; |
416 | 416 | ||
417 | struct_err: | 417 | struct_err: |
418 | i2c_set_clientdata(i2c, NULL); | ||
419 | kfree(wm8400); | 418 | kfree(wm8400); |
420 | err: | 419 | err: |
421 | return ret; | 420 | return ret; |
@@ -426,7 +425,6 @@ static int wm8400_i2c_remove(struct i2c_client *i2c) | |||
426 | struct wm8400 *wm8400 = i2c_get_clientdata(i2c); | 425 | struct wm8400 *wm8400 = i2c_get_clientdata(i2c); |
427 | 426 | ||
428 | wm8400_release(wm8400); | 427 | wm8400_release(wm8400); |
429 | i2c_set_clientdata(i2c, NULL); | ||
430 | kfree(wm8400); | 428 | kfree(wm8400); |
431 | 429 | ||
432 | return 0; | 430 | return 0; |
diff --git a/drivers/misc/eeprom/at24.c b/drivers/misc/eeprom/at24.c index f7ca3a42b49..559b0b3c16c 100644 --- a/drivers/misc/eeprom/at24.c +++ b/drivers/misc/eeprom/at24.c | |||
@@ -643,7 +643,6 @@ static int __devexit at24_remove(struct i2c_client *client) | |||
643 | 643 | ||
644 | kfree(at24->writebuf); | 644 | kfree(at24->writebuf); |
645 | kfree(at24); | 645 | kfree(at24); |
646 | i2c_set_clientdata(client, NULL); | ||
647 | return 0; | 646 | return 0; |
648 | } | 647 | } |
649 | 648 | ||
diff --git a/drivers/mtd/maps/pismo.c b/drivers/mtd/maps/pismo.c index eb476b7f8d1..f4ce273e93f 100644 --- a/drivers/mtd/maps/pismo.c +++ b/drivers/mtd/maps/pismo.c | |||
@@ -234,7 +234,6 @@ static int __devexit pismo_remove(struct i2c_client *client) | |||
234 | /* FIXME: set_vpp needs saner arguments */ | 234 | /* FIXME: set_vpp needs saner arguments */ |
235 | pismo_setvpp_remove_fix(pismo); | 235 | pismo_setvpp_remove_fix(pismo); |
236 | 236 | ||
237 | i2c_set_clientdata(client, NULL); | ||
238 | kfree(pismo); | 237 | kfree(pismo); |
239 | 238 | ||
240 | return 0; | 239 | return 0; |
@@ -286,7 +285,6 @@ static int __devinit pismo_probe(struct i2c_client *client, | |||
286 | return 0; | 285 | return 0; |
287 | 286 | ||
288 | exit_free: | 287 | exit_free: |
289 | i2c_set_clientdata(client, NULL); | ||
290 | kfree(pismo); | 288 | kfree(pismo); |
291 | return ret; | 289 | return ret; |
292 | } | 290 | } |
diff --git a/drivers/power/max17040_battery.c b/drivers/power/max17040_battery.c index f3e22c9fe20..2f2f9a6f54f 100644 --- a/drivers/power/max17040_battery.c +++ b/drivers/power/max17040_battery.c | |||
@@ -225,7 +225,6 @@ static int __devinit max17040_probe(struct i2c_client *client, | |||
225 | ret = power_supply_register(&client->dev, &chip->battery); | 225 | ret = power_supply_register(&client->dev, &chip->battery); |
226 | if (ret) { | 226 | if (ret) { |
227 | dev_err(&client->dev, "failed: power supply register\n"); | 227 | dev_err(&client->dev, "failed: power supply register\n"); |
228 | i2c_set_clientdata(client, NULL); | ||
229 | kfree(chip); | 228 | kfree(chip); |
230 | return ret; | 229 | return ret; |
231 | } | 230 | } |
@@ -245,7 +244,6 @@ static int __devexit max17040_remove(struct i2c_client *client) | |||
245 | 244 | ||
246 | power_supply_unregister(&chip->battery); | 245 | power_supply_unregister(&chip->battery); |
247 | cancel_delayed_work(&chip->work); | 246 | cancel_delayed_work(&chip->work); |
248 | i2c_set_clientdata(client, NULL); | ||
249 | kfree(chip); | 247 | kfree(chip); |
250 | return 0; | 248 | return 0; |
251 | } | 249 | } |
diff --git a/drivers/regulator/lp3971.c b/drivers/regulator/lp3971.c index 671a7d1f1f0..8ae3732eb24 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 b3c1afc1688..2b54d9d75f1 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 bfc4c5ffdc9..4520ace3f7e 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; |
359 | out: | 359 | out: |
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 3790b21879f..d97220efae5 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 8e2f2098b00..f50afc9f287 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 | ||
diff --git a/drivers/rtc/rtc-ds1374.c b/drivers/rtc/rtc-ds1374.c index 61945734ad0..1f0007fd443 100644 --- a/drivers/rtc/rtc-ds1374.c +++ b/drivers/rtc/rtc-ds1374.c | |||
@@ -403,7 +403,6 @@ out_irq: | |||
403 | free_irq(client->irq, client); | 403 | free_irq(client->irq, client); |
404 | 404 | ||
405 | out_free: | 405 | out_free: |
406 | i2c_set_clientdata(client, NULL); | ||
407 | kfree(ds1374); | 406 | kfree(ds1374); |
408 | return ret; | 407 | return ret; |
409 | } | 408 | } |
@@ -422,7 +421,6 @@ static int __devexit ds1374_remove(struct i2c_client *client) | |||
422 | } | 421 | } |
423 | 422 | ||
424 | rtc_device_unregister(ds1374->rtc); | 423 | rtc_device_unregister(ds1374->rtc); |
425 | i2c_set_clientdata(client, NULL); | ||
426 | kfree(ds1374); | 424 | kfree(ds1374); |
427 | return 0; | 425 | return 0; |
428 | } | 426 | } |
diff --git a/drivers/rtc/rtc-rx8025.c b/drivers/rtc/rtc-rx8025.c index b65c82f792d..789f62f9b47 100644 --- a/drivers/rtc/rtc-rx8025.c +++ b/drivers/rtc/rtc-rx8025.c | |||
@@ -632,7 +632,6 @@ errout_reg: | |||
632 | rtc_device_unregister(rx8025->rtc); | 632 | rtc_device_unregister(rx8025->rtc); |
633 | 633 | ||
634 | errout_free: | 634 | errout_free: |
635 | i2c_set_clientdata(client, NULL); | ||
636 | kfree(rx8025); | 635 | kfree(rx8025); |
637 | 636 | ||
638 | errout: | 637 | errout: |
@@ -656,7 +655,6 @@ static int __devexit rx8025_remove(struct i2c_client *client) | |||
656 | 655 | ||
657 | rx8025_sysfs_unregister(&client->dev); | 656 | rx8025_sysfs_unregister(&client->dev); |
658 | rtc_device_unregister(rx8025->rtc); | 657 | rtc_device_unregister(rx8025->rtc); |
659 | i2c_set_clientdata(client, NULL); | ||
660 | kfree(rx8025); | 658 | kfree(rx8025); |
661 | return 0; | 659 | return 0; |
662 | } | 660 | } |
diff --git a/drivers/rtc/rtc-s35390a.c b/drivers/rtc/rtc-s35390a.c index def4d396d0b..f789e002c9b 100644 --- a/drivers/rtc/rtc-s35390a.c +++ b/drivers/rtc/rtc-s35390a.c | |||
@@ -275,7 +275,6 @@ exit_dummy: | |||
275 | if (s35390a->client[i]) | 275 | if (s35390a->client[i]) |
276 | i2c_unregister_device(s35390a->client[i]); | 276 | i2c_unregister_device(s35390a->client[i]); |
277 | kfree(s35390a); | 277 | kfree(s35390a); |
278 | i2c_set_clientdata(client, NULL); | ||
279 | 278 | ||
280 | exit: | 279 | exit: |
281 | return err; | 280 | return err; |
@@ -292,7 +291,6 @@ static int s35390a_remove(struct i2c_client *client) | |||
292 | 291 | ||
293 | rtc_device_unregister(s35390a->rtc); | 292 | rtc_device_unregister(s35390a->rtc); |
294 | kfree(s35390a); | 293 | kfree(s35390a); |
295 | i2c_set_clientdata(client, NULL); | ||
296 | 294 | ||
297 | return 0; | 295 | return 0; |
298 | } | 296 | } |
diff --git a/drivers/staging/dream/synaptics_i2c_rmi.c b/drivers/staging/dream/synaptics_i2c_rmi.c index 1f020dad623..3320359408a 100644 --- a/drivers/staging/dream/synaptics_i2c_rmi.c +++ b/drivers/staging/dream/synaptics_i2c_rmi.c | |||
@@ -519,7 +519,6 @@ err_input_register_device_failed: | |||
519 | err_input_dev_alloc_failed: | 519 | err_input_dev_alloc_failed: |
520 | err_detect_failed: | 520 | err_detect_failed: |
521 | err_power_failed: | 521 | err_power_failed: |
522 | i2c_set_clientdata(client, NULL); | ||
523 | kfree(ts); | 522 | kfree(ts); |
524 | err_alloc_data_failed: | 523 | err_alloc_data_failed: |
525 | err_check_functionality_failed: | 524 | err_check_functionality_failed: |
@@ -537,7 +536,6 @@ static int synaptics_ts_remove(struct i2c_client *client) | |||
537 | else | 536 | else |
538 | hrtimer_cancel(&ts->timer); | 537 | hrtimer_cancel(&ts->timer); |
539 | input_unregister_device(ts->input_dev); | 538 | input_unregister_device(ts->input_dev); |
540 | i2c_set_clientdata(client, NULL); | ||
541 | kfree(ts); | 539 | kfree(ts); |
542 | return 0; | 540 | return 0; |
543 | } | 541 | } |
diff --git a/drivers/staging/go7007/wis-saa7113.c b/drivers/staging/go7007/wis-saa7113.c index bd925457f8b..72f5c1f56d1 100644 --- a/drivers/staging/go7007/wis-saa7113.c +++ b/drivers/staging/go7007/wis-saa7113.c | |||
@@ -289,7 +289,6 @@ static int wis_saa7113_probe(struct i2c_client *client, | |||
289 | if (write_regs(client, initial_registers) < 0) { | 289 | if (write_regs(client, initial_registers) < 0) { |
290 | printk(KERN_ERR | 290 | printk(KERN_ERR |
291 | "wis-saa7113: error initializing SAA7113\n"); | 291 | "wis-saa7113: error initializing SAA7113\n"); |
292 | i2c_set_clientdata(client, NULL); | ||
293 | kfree(dec); | 292 | kfree(dec); |
294 | return -ENODEV; | 293 | return -ENODEV; |
295 | } | 294 | } |
@@ -301,7 +300,6 @@ static int wis_saa7113_remove(struct i2c_client *client) | |||
301 | { | 300 | { |
302 | struct wis_saa7113 *dec = i2c_get_clientdata(client); | 301 | struct wis_saa7113 *dec = i2c_get_clientdata(client); |
303 | 302 | ||
304 | i2c_set_clientdata(client, NULL); | ||
305 | kfree(dec); | 303 | kfree(dec); |
306 | return 0; | 304 | return 0; |
307 | } | 305 | } |
diff --git a/drivers/staging/go7007/wis-saa7115.c b/drivers/staging/go7007/wis-saa7115.c index b2eb804c195..cd950b61cf7 100644 --- a/drivers/staging/go7007/wis-saa7115.c +++ b/drivers/staging/go7007/wis-saa7115.c | |||
@@ -422,7 +422,6 @@ static int wis_saa7115_probe(struct i2c_client *client, | |||
422 | if (write_regs(client, initial_registers) < 0) { | 422 | if (write_regs(client, initial_registers) < 0) { |
423 | printk(KERN_ERR | 423 | printk(KERN_ERR |
424 | "wis-saa7115: error initializing SAA7115\n"); | 424 | "wis-saa7115: error initializing SAA7115\n"); |
425 | i2c_set_clientdata(client, NULL); | ||
426 | kfree(dec); | 425 | kfree(dec); |
427 | return -ENODEV; | 426 | return -ENODEV; |
428 | } | 427 | } |
@@ -434,7 +433,6 @@ static int wis_saa7115_remove(struct i2c_client *client) | |||
434 | { | 433 | { |
435 | struct wis_saa7115 *dec = i2c_get_clientdata(client); | 434 | struct wis_saa7115 *dec = i2c_get_clientdata(client); |
436 | 435 | ||
437 | i2c_set_clientdata(client, NULL); | ||
438 | kfree(dec); | 436 | kfree(dec); |
439 | return 0; | 437 | return 0; |
440 | } | 438 | } |
diff --git a/drivers/staging/go7007/wis-sony-tuner.c b/drivers/staging/go7007/wis-sony-tuner.c index b1013291190..981c9b311b8 100644 --- a/drivers/staging/go7007/wis-sony-tuner.c +++ b/drivers/staging/go7007/wis-sony-tuner.c | |||
@@ -684,7 +684,6 @@ static int wis_sony_tuner_remove(struct i2c_client *client) | |||
684 | { | 684 | { |
685 | struct wis_sony_tuner *t = i2c_get_clientdata(client); | 685 | struct wis_sony_tuner *t = i2c_get_clientdata(client); |
686 | 686 | ||
687 | i2c_set_clientdata(client, NULL); | ||
688 | kfree(t); | 687 | kfree(t); |
689 | return 0; | 688 | return 0; |
690 | } | 689 | } |
diff --git a/drivers/staging/go7007/wis-tw2804.c b/drivers/staging/go7007/wis-tw2804.c index 315268d130d..ee28a99dc38 100644 --- a/drivers/staging/go7007/wis-tw2804.c +++ b/drivers/staging/go7007/wis-tw2804.c | |||
@@ -323,7 +323,6 @@ static int wis_tw2804_remove(struct i2c_client *client) | |||
323 | { | 323 | { |
324 | struct wis_tw2804 *dec = i2c_get_clientdata(client); | 324 | struct wis_tw2804 *dec = i2c_get_clientdata(client); |
325 | 325 | ||
326 | i2c_set_clientdata(client, NULL); | ||
327 | kfree(dec); | 326 | kfree(dec); |
328 | return 0; | 327 | return 0; |
329 | } | 328 | } |
diff --git a/drivers/staging/go7007/wis-tw9903.c b/drivers/staging/go7007/wis-tw9903.c index 2afea09091b..80d47269b1c 100644 --- a/drivers/staging/go7007/wis-tw9903.c +++ b/drivers/staging/go7007/wis-tw9903.c | |||
@@ -294,7 +294,6 @@ static int wis_tw9903_probe(struct i2c_client *client, | |||
294 | 294 | ||
295 | if (write_regs(client, initial_registers) < 0) { | 295 | if (write_regs(client, initial_registers) < 0) { |
296 | printk(KERN_ERR "wis-tw9903: error initializing TW9903\n"); | 296 | printk(KERN_ERR "wis-tw9903: error initializing TW9903\n"); |
297 | i2c_set_clientdata(client, NULL); | ||
298 | kfree(dec); | 297 | kfree(dec); |
299 | return -ENODEV; | 298 | return -ENODEV; |
300 | } | 299 | } |
@@ -306,7 +305,6 @@ static int wis_tw9903_remove(struct i2c_client *client) | |||
306 | { | 305 | { |
307 | struct wis_tw9903 *dec = i2c_get_clientdata(client); | 306 | struct wis_tw9903 *dec = i2c_get_clientdata(client); |
308 | 307 | ||
309 | i2c_set_clientdata(client, NULL); | ||
310 | kfree(dec); | 308 | kfree(dec); |
311 | return 0; | 309 | return 0; |
312 | } | 310 | } |
diff --git a/drivers/staging/iio/adc/max1363_core.c b/drivers/staging/iio/adc/max1363_core.c index 20e267448d1..905f8560d31 100644 --- a/drivers/staging/iio/adc/max1363_core.c +++ b/drivers/staging/iio/adc/max1363_core.c | |||
@@ -1011,7 +1011,6 @@ error_put_reg: | |||
1011 | if (!IS_ERR(st->reg)) | 1011 | if (!IS_ERR(st->reg)) |
1012 | regulator_put(st->reg); | 1012 | regulator_put(st->reg); |
1013 | error_free_st: | 1013 | error_free_st: |
1014 | i2c_set_clientdata(client, NULL); | ||
1015 | kfree(st); | 1014 | kfree(st); |
1016 | 1015 | ||
1017 | error_ret: | 1016 | error_ret: |
@@ -1030,7 +1029,6 @@ static int max1363_remove(struct i2c_client *client) | |||
1030 | regulator_disable(st->reg); | 1029 | regulator_disable(st->reg); |
1031 | regulator_put(st->reg); | 1030 | regulator_put(st->reg); |
1032 | } | 1031 | } |
1033 | i2c_set_clientdata(client, NULL); | ||
1034 | kfree(st); | 1032 | kfree(st); |
1035 | 1033 | ||
1036 | return 0; | 1034 | return 0; |
diff --git a/drivers/staging/iio/light/tsl2563.c b/drivers/staging/iio/light/tsl2563.c index 43aaacff4e7..e4b0a5ef1c1 100644 --- a/drivers/staging/iio/light/tsl2563.c +++ b/drivers/staging/iio/light/tsl2563.c | |||
@@ -694,7 +694,6 @@ static int __devinit tsl2563_probe(struct i2c_client *client, | |||
694 | fail2: | 694 | fail2: |
695 | iio_device_unregister(chip->indio_dev); | 695 | iio_device_unregister(chip->indio_dev); |
696 | fail1: | 696 | fail1: |
697 | i2c_set_clientdata(client, NULL); | ||
698 | kfree(chip); | 697 | kfree(chip); |
699 | return err; | 698 | return err; |
700 | } | 699 | } |
@@ -705,7 +704,6 @@ static int tsl2563_remove(struct i2c_client *client) | |||
705 | 704 | ||
706 | iio_device_unregister(chip->indio_dev); | 705 | iio_device_unregister(chip->indio_dev); |
707 | 706 | ||
708 | i2c_set_clientdata(client, NULL); | ||
709 | kfree(chip); | 707 | kfree(chip); |
710 | return 0; | 708 | return 0; |
711 | } | 709 | } |
diff --git a/drivers/video/backlight/adp8860_bl.c b/drivers/video/backlight/adp8860_bl.c index 921ca37398f..3ec24609151 100644 --- a/drivers/video/backlight/adp8860_bl.c +++ b/drivers/video/backlight/adp8860_bl.c | |||
@@ -756,7 +756,6 @@ out: | |||
756 | out1: | 756 | out1: |
757 | backlight_device_unregister(bl); | 757 | backlight_device_unregister(bl); |
758 | out2: | 758 | out2: |
759 | i2c_set_clientdata(client, NULL); | ||
760 | kfree(data); | 759 | kfree(data); |
761 | 760 | ||
762 | return ret; | 761 | return ret; |
@@ -776,7 +775,6 @@ static int __devexit adp8860_remove(struct i2c_client *client) | |||
776 | &adp8860_bl_attr_group); | 775 | &adp8860_bl_attr_group); |
777 | 776 | ||
778 | backlight_device_unregister(data->bl); | 777 | backlight_device_unregister(data->bl); |
779 | i2c_set_clientdata(client, NULL); | ||
780 | kfree(data); | 778 | kfree(data); |
781 | 779 | ||
782 | return 0; | 780 | return 0; |
diff --git a/drivers/video/backlight/tosa_bl.c b/drivers/video/backlight/tosa_bl.c index e03e60bbfd8..2a04b382ec4 100644 --- a/drivers/video/backlight/tosa_bl.c +++ b/drivers/video/backlight/tosa_bl.c | |||
@@ -119,7 +119,6 @@ static int __devinit tosa_bl_probe(struct i2c_client *client, | |||
119 | 119 | ||
120 | err_reg: | 120 | err_reg: |
121 | data->bl = NULL; | 121 | data->bl = NULL; |
122 | i2c_set_clientdata(client, NULL); | ||
123 | err_gpio_dir: | 122 | err_gpio_dir: |
124 | gpio_free(TOSA_GPIO_BL_C20MA); | 123 | gpio_free(TOSA_GPIO_BL_C20MA); |
125 | err_gpio_bl: | 124 | err_gpio_bl: |
@@ -133,7 +132,6 @@ static int __devexit tosa_bl_remove(struct i2c_client *client) | |||
133 | 132 | ||
134 | backlight_device_unregister(data->bl); | 133 | backlight_device_unregister(data->bl); |
135 | data->bl = NULL; | 134 | data->bl = NULL; |
136 | i2c_set_clientdata(client, NULL); | ||
137 | 135 | ||
138 | gpio_free(TOSA_GPIO_BL_C20MA); | 136 | gpio_free(TOSA_GPIO_BL_C20MA); |
139 | 137 | ||