Commit fbae3fb1546e199ab0cd185348f8124411a1ca9d
Committed by
Jean Delvare
1 parent
35bfc353dc
Exists in
master
and in
4 other branches
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>
Showing 75 changed files with 4 additions and 141 deletions Side-by-side Diff
- drivers/hwmon/adt7411.c
- drivers/hwmon/asc7621.c
- drivers/hwmon/f75375s.c
- drivers/hwmon/g760a.c
- drivers/hwmon/lm73.c
- drivers/hwmon/lm75.c
- drivers/hwmon/lm95241.c
- drivers/hwmon/tmp102.c
- drivers/hwmon/tmp421.c
- drivers/hwmon/w83781d.c
- drivers/i2c/i2c-smbus.c
- drivers/input/keyboard/adp5588-keys.c
- drivers/input/keyboard/lm8323.c
- drivers/input/keyboard/max7359_keypad.c
- drivers/input/keyboard/qt2160.c
- drivers/input/keyboard/tca6416-keypad.c
- drivers/input/misc/ad714x-i2c.c
- drivers/input/misc/pcf8574_keypad.c
- drivers/input/mouse/synaptics_i2c.c
- drivers/input/touchscreen/ad7879.c
- drivers/input/touchscreen/eeti_ts.c
- drivers/input/touchscreen/mcs5000_ts.c
- drivers/input/touchscreen/tsc2007.c
- drivers/leds/leds-bd2802.c
- drivers/leds/leds-lp3944.c
- drivers/leds/leds-pca9532.c
- drivers/leds/leds-pca955x.c
- drivers/macintosh/therm_adt746x.c
- drivers/macintosh/windfarm_lm75_sensor.c
- drivers/macintosh/windfarm_max6690_sensor.c
- drivers/macintosh/windfarm_smu_sat.c
- drivers/media/radio/si470x/radio-si470x-i2c.c
- drivers/media/video/mt9m001.c
- drivers/media/video/mt9m111.c
- drivers/media/video/mt9t031.c
- drivers/media/video/mt9t112.c
- drivers/media/video/mt9v022.c
- drivers/media/video/ov772x.c
- drivers/media/video/ov9640.c
- drivers/media/video/rj54n1cb0c.c
- drivers/media/video/tcm825x.c
- drivers/media/video/tw9910.c
- drivers/mfd/88pm860x-i2c.c
- drivers/mfd/ab3100-core.c
- drivers/mfd/ab3550-core.c
- drivers/mfd/adp5520.c
- drivers/mfd/da903x.c
- drivers/mfd/max8925-i2c.c
- drivers/mfd/menelaus.c
- drivers/mfd/pcf50633-core.c
- drivers/mfd/tc35892.c
- drivers/mfd/tps65010.c
- drivers/mfd/wm8350-i2c.c
- drivers/mfd/wm8400-core.c
- drivers/misc/eeprom/at24.c
- drivers/mtd/maps/pismo.c
- drivers/power/max17040_battery.c
- drivers/regulator/lp3971.c
- drivers/regulator/max1586.c
- drivers/regulator/max8649.c
- drivers/regulator/max8660.c
- drivers/regulator/tps65023-regulator.c
- drivers/rtc/rtc-ds1374.c
- drivers/rtc/rtc-rx8025.c
- drivers/rtc/rtc-s35390a.c
- drivers/staging/dream/synaptics_i2c_rmi.c
- drivers/staging/go7007/wis-saa7113.c
- drivers/staging/go7007/wis-saa7115.c
- drivers/staging/go7007/wis-sony-tuner.c
- drivers/staging/go7007/wis-tw2804.c
- drivers/staging/go7007/wis-tw9903.c
- drivers/staging/iio/adc/max1363_core.c
- drivers/staging/iio/light/tsl2563.c
- drivers/video/backlight/adp8860_bl.c
- drivers/video/backlight/tosa_bl.c
drivers/hwmon/adt7411.c
... | ... | @@ -316,7 +316,6 @@ |
316 | 316 | exit_remove: |
317 | 317 | sysfs_remove_group(&client->dev.kobj, &adt7411_attr_grp); |
318 | 318 | exit_free: |
319 | - i2c_set_clientdata(client, NULL); | |
320 | 319 | kfree(data); |
321 | 320 | return ret; |
322 | 321 | } |
... | ... | @@ -327,7 +326,6 @@ |
327 | 326 | |
328 | 327 | hwmon_device_unregister(data->hwmon_dev); |
329 | 328 | sysfs_remove_group(&client->dev.kobj, &adt7411_attr_grp); |
330 | - i2c_set_clientdata(client, NULL); | |
331 | 329 | kfree(data); |
332 | 330 | return 0; |
333 | 331 | } |
drivers/hwmon/asc7621.c
... | ... | @@ -1141,7 +1141,6 @@ |
1141 | 1141 | &(asc7621_params[i].sda.dev_attr)); |
1142 | 1142 | } |
1143 | 1143 | |
1144 | - i2c_set_clientdata(client, NULL); | |
1145 | 1144 | kfree(data); |
1146 | 1145 | return err; |
1147 | 1146 | } |
... | ... | @@ -1196,7 +1195,6 @@ |
1196 | 1195 | &(asc7621_params[i].sda.dev_attr)); |
1197 | 1196 | } |
1198 | 1197 | |
1199 | - i2c_set_clientdata(client, NULL); | |
1200 | 1198 | kfree(data); |
1201 | 1199 | return 0; |
1202 | 1200 | } |
drivers/hwmon/f75375s.c
... | ... | @@ -662,7 +662,6 @@ |
662 | 662 | sysfs_remove_group(&client->dev.kobj, &f75375_group); |
663 | 663 | exit_free: |
664 | 664 | kfree(data); |
665 | - i2c_set_clientdata(client, NULL); | |
666 | 665 | return err; |
667 | 666 | } |
668 | 667 | |
... | ... | @@ -672,7 +671,6 @@ |
672 | 671 | hwmon_device_unregister(data->hwmon_dev); |
673 | 672 | sysfs_remove_group(&client->dev.kobj, &f75375_group); |
674 | 673 | kfree(data); |
675 | - i2c_set_clientdata(client, NULL); | |
676 | 674 | return 0; |
677 | 675 | } |
678 | 676 |
drivers/hwmon/g760a.c
... | ... | @@ -236,7 +236,6 @@ |
236 | 236 | sysfs_remove_group(&client->dev.kobj, &g760a_group); |
237 | 237 | error_sysfs_create_group: |
238 | 238 | kfree(data); |
239 | - i2c_set_clientdata(client, NULL); | |
240 | 239 | |
241 | 240 | return err; |
242 | 241 | } |
... | ... | @@ -247,7 +246,6 @@ |
247 | 246 | hwmon_device_unregister(data->hwmon_dev); |
248 | 247 | sysfs_remove_group(&client->dev.kobj, &g760a_group); |
249 | 248 | kfree(data); |
250 | - i2c_set_clientdata(client, NULL); | |
251 | 249 | |
252 | 250 | return 0; |
253 | 251 | } |
drivers/hwmon/lm73.c
drivers/hwmon/lm75.c
... | ... | @@ -192,7 +192,6 @@ |
192 | 192 | exit_remove: |
193 | 193 | sysfs_remove_group(&client->dev.kobj, &lm75_group); |
194 | 194 | exit_free: |
195 | - i2c_set_clientdata(client, NULL); | |
196 | 195 | kfree(data); |
197 | 196 | return status; |
198 | 197 | } |
... | ... | @@ -204,7 +203,6 @@ |
204 | 203 | hwmon_device_unregister(data->hwmon_dev); |
205 | 204 | sysfs_remove_group(&client->dev.kobj, &lm75_group); |
206 | 205 | lm75_write_value(client, LM75_REG_CONF, data->orig_conf); |
207 | - i2c_set_clientdata(client, NULL); | |
208 | 206 | kfree(data); |
209 | 207 | return 0; |
210 | 208 | } |
drivers/hwmon/lm95241.c
drivers/hwmon/tmp102.c
... | ... | @@ -224,7 +224,6 @@ |
224 | 224 | fail_restore_config: |
225 | 225 | tmp102_write_reg(client, TMP102_CONF_REG, tmp102->config_orig); |
226 | 226 | fail_free: |
227 | - i2c_set_clientdata(client, NULL); | |
228 | 227 | kfree(tmp102); |
229 | 228 | |
230 | 229 | return status; |
... | ... | @@ -247,7 +246,6 @@ |
247 | 246 | config | TMP102_CONF_SD); |
248 | 247 | } |
249 | 248 | |
250 | - i2c_set_clientdata(client, NULL); | |
251 | 249 | kfree(tmp102); |
252 | 250 | |
253 | 251 | return 0; |
drivers/hwmon/tmp421.c
... | ... | @@ -295,7 +295,6 @@ |
295 | 295 | sysfs_remove_group(&client->dev.kobj, &tmp421_group); |
296 | 296 | |
297 | 297 | exit_free: |
298 | - i2c_set_clientdata(client, NULL); | |
299 | 298 | kfree(data); |
300 | 299 | |
301 | 300 | return err; |
... | ... | @@ -308,7 +307,6 @@ |
308 | 307 | hwmon_device_unregister(data->hwmon_dev); |
309 | 308 | sysfs_remove_group(&client->dev.kobj, &tmp421_group); |
310 | 309 | |
311 | - i2c_set_clientdata(client, NULL); | |
312 | 310 | kfree(data); |
313 | 311 | |
314 | 312 | return 0; |
drivers/hwmon/w83781d.c
... | ... | @@ -1197,7 +1197,6 @@ |
1197 | 1197 | if (data->lm75[1]) |
1198 | 1198 | i2c_unregister_device(data->lm75[1]); |
1199 | 1199 | ERROR3: |
1200 | - i2c_set_clientdata(client, NULL); | |
1201 | 1200 | kfree(data); |
1202 | 1201 | ERROR1: |
1203 | 1202 | return err; |
... | ... | @@ -1219,7 +1218,6 @@ |
1219 | 1218 | if (data->lm75[1]) |
1220 | 1219 | i2c_unregister_device(data->lm75[1]); |
1221 | 1220 | |
1222 | - i2c_set_clientdata(client, NULL); | |
1223 | 1221 | kfree(data); |
1224 | 1222 | |
1225 | 1223 | return 0; |
drivers/i2c/i2c-smbus.c
drivers/input/keyboard/adp5588-keys.c
drivers/input/keyboard/lm8323.c
drivers/input/keyboard/max7359_keypad.c
drivers/input/keyboard/qt2160.c
drivers/input/keyboard/tca6416-keypad.c
drivers/input/misc/ad714x-i2c.c
drivers/input/misc/pcf8574_keypad.c
drivers/input/mouse/synaptics_i2c.c
drivers/input/touchscreen/ad7879.c
... | ... | @@ -812,10 +812,8 @@ |
812 | 812 | ts->bus = client; |
813 | 813 | |
814 | 814 | error = ad7879_construct(client, ts); |
815 | - if (error) { | |
816 | - i2c_set_clientdata(client, NULL); | |
815 | + if (error) | |
817 | 816 | kfree(ts); |
818 | - } | |
819 | 817 | |
820 | 818 | return error; |
821 | 819 | } |
... | ... | @@ -825,7 +823,6 @@ |
825 | 823 | struct ad7879 *ts = dev_get_drvdata(&client->dev); |
826 | 824 | |
827 | 825 | ad7879_destroy(client, ts); |
828 | - i2c_set_clientdata(client, NULL); | |
829 | 826 | kfree(ts); |
830 | 827 | |
831 | 828 | return 0; |
drivers/input/touchscreen/eeti_ts.c
... | ... | @@ -238,7 +238,6 @@ |
238 | 238 | input = NULL; /* so we dont try to free it below */ |
239 | 239 | err1: |
240 | 240 | input_free_device(input); |
241 | - i2c_set_clientdata(client, NULL); | |
242 | 241 | kfree(priv); |
243 | 242 | err0: |
244 | 243 | return err; |
... | ... | @@ -256,7 +255,6 @@ |
256 | 255 | enable_irq(priv->irq); |
257 | 256 | |
258 | 257 | input_unregister_device(priv->input); |
259 | - i2c_set_clientdata(client, NULL); | |
260 | 258 | kfree(priv); |
261 | 259 | |
262 | 260 | return 0; |
drivers/input/touchscreen/mcs5000_ts.c
drivers/input/touchscreen/tsc2007.c
drivers/leds/leds-bd2802.c
... | ... | @@ -742,7 +742,6 @@ |
742 | 742 | for (i--; i >= 0; i--) |
743 | 743 | device_remove_file(&led->client->dev, bd2802_attributes[i]); |
744 | 744 | failed_free: |
745 | - i2c_set_clientdata(client, NULL); | |
746 | 745 | kfree(led); |
747 | 746 | |
748 | 747 | return ret; |
... | ... | @@ -759,7 +758,6 @@ |
759 | 758 | bd2802_disable_adv_conf(led); |
760 | 759 | for (i = 0; i < ARRAY_SIZE(bd2802_attributes); i++) |
761 | 760 | device_remove_file(&led->client->dev, bd2802_attributes[i]); |
762 | - i2c_set_clientdata(client, NULL); | |
763 | 761 | kfree(led); |
764 | 762 | |
765 | 763 | return 0; |
drivers/leds/leds-lp3944.c
drivers/leds/leds-pca9532.c
... | ... | @@ -320,10 +320,8 @@ |
320 | 320 | mutex_init(&data->update_lock); |
321 | 321 | |
322 | 322 | err = pca9532_configure(client, data, pca9532_pdata); |
323 | - if (err) { | |
323 | + if (err) | |
324 | 324 | kfree(data); |
325 | - i2c_set_clientdata(client, NULL); | |
326 | - } | |
327 | 325 | |
328 | 326 | return err; |
329 | 327 | } |
... | ... | @@ -351,7 +349,6 @@ |
351 | 349 | } |
352 | 350 | |
353 | 351 | kfree(data); |
354 | - i2c_set_clientdata(client, NULL); | |
355 | 352 | return 0; |
356 | 353 | } |
357 | 354 |
drivers/leds/leds-pca955x.c
drivers/macintosh/therm_adt746x.c
... | ... | @@ -182,7 +182,6 @@ |
182 | 182 | |
183 | 183 | thermostat = NULL; |
184 | 184 | |
185 | - i2c_set_clientdata(client, NULL); | |
186 | 185 | kfree(th); |
187 | 186 | |
188 | 187 | return 0; |
... | ... | @@ -400,7 +399,6 @@ |
400 | 399 | rc = read_reg(th, CONFIG_REG); |
401 | 400 | if (rc < 0) { |
402 | 401 | dev_err(&client->dev, "Thermostat failed to read config!\n"); |
403 | - i2c_set_clientdata(client, NULL); | |
404 | 402 | kfree(th); |
405 | 403 | return -ENODEV; |
406 | 404 | } |
drivers/macintosh/windfarm_lm75_sensor.c
... | ... | @@ -107,10 +107,8 @@ |
107 | 107 | i2c_set_clientdata(client, lm); |
108 | 108 | |
109 | 109 | rc = wf_register_sensor(&lm->sens); |
110 | - if (rc) { | |
111 | - i2c_set_clientdata(client, NULL); | |
110 | + if (rc) | |
112 | 111 | kfree(lm); |
113 | - } | |
114 | 112 | |
115 | 113 | return rc; |
116 | 114 | } |
... | ... | @@ -216,7 +214,6 @@ |
216 | 214 | /* release sensor */ |
217 | 215 | wf_unregister_sensor(&lm->sens); |
218 | 216 | |
219 | - i2c_set_clientdata(client, NULL); | |
220 | 217 | return 0; |
221 | 218 | } |
222 | 219 |
drivers/macintosh/windfarm_max6690_sensor.c
drivers/macintosh/windfarm_smu_sat.c
drivers/media/radio/si470x/radio-si470x-i2c.c
drivers/media/video/mt9m001.c
... | ... | @@ -785,7 +785,6 @@ |
785 | 785 | ret = mt9m001_video_probe(icd, client); |
786 | 786 | if (ret) { |
787 | 787 | icd->ops = NULL; |
788 | - i2c_set_clientdata(client, NULL); | |
789 | 788 | kfree(mt9m001); |
790 | 789 | } |
791 | 790 | |
... | ... | @@ -799,7 +798,6 @@ |
799 | 798 | |
800 | 799 | icd->ops = NULL; |
801 | 800 | mt9m001_video_remove(icd); |
802 | - i2c_set_clientdata(client, NULL); | |
803 | 801 | client->driver = NULL; |
804 | 802 | kfree(mt9m001); |
805 | 803 |
drivers/media/video/mt9m111.c
... | ... | @@ -1068,7 +1068,6 @@ |
1068 | 1068 | ret = mt9m111_video_probe(icd, client); |
1069 | 1069 | if (ret) { |
1070 | 1070 | icd->ops = NULL; |
1071 | - i2c_set_clientdata(client, NULL); | |
1072 | 1071 | kfree(mt9m111); |
1073 | 1072 | } |
1074 | 1073 | |
... | ... | @@ -1081,7 +1080,6 @@ |
1081 | 1080 | struct soc_camera_device *icd = client->dev.platform_data; |
1082 | 1081 | |
1083 | 1082 | icd->ops = NULL; |
1084 | - i2c_set_clientdata(client, NULL); | |
1085 | 1083 | client->driver = NULL; |
1086 | 1084 | kfree(mt9m111); |
1087 | 1085 |
drivers/media/video/mt9t031.c
... | ... | @@ -883,7 +883,6 @@ |
883 | 883 | if (ret) { |
884 | 884 | if (icd) |
885 | 885 | icd->ops = NULL; |
886 | - i2c_set_clientdata(client, NULL); | |
887 | 886 | kfree(mt9t031); |
888 | 887 | } |
889 | 888 | |
... | ... | @@ -897,7 +896,6 @@ |
897 | 896 | |
898 | 897 | if (icd) |
899 | 898 | icd->ops = NULL; |
900 | - i2c_set_clientdata(client, NULL); | |
901 | 899 | client->driver = NULL; |
902 | 900 | kfree(mt9t031); |
903 | 901 |
drivers/media/video/mt9t112.c
... | ... | @@ -1119,7 +1119,6 @@ |
1119 | 1119 | ret = mt9t112_camera_probe(icd, client); |
1120 | 1120 | if (ret) { |
1121 | 1121 | icd->ops = NULL; |
1122 | - i2c_set_clientdata(client, NULL); | |
1123 | 1122 | kfree(priv); |
1124 | 1123 | } |
1125 | 1124 | |
... | ... | @@ -1132,7 +1131,6 @@ |
1132 | 1131 | struct soc_camera_device *icd = client->dev.platform_data; |
1133 | 1132 | |
1134 | 1133 | icd->ops = NULL; |
1135 | - i2c_set_clientdata(client, NULL); | |
1136 | 1134 | kfree(priv); |
1137 | 1135 | return 0; |
1138 | 1136 | } |
drivers/media/video/mt9v022.c
... | ... | @@ -920,7 +920,6 @@ |
920 | 920 | ret = mt9v022_video_probe(icd, client); |
921 | 921 | if (ret) { |
922 | 922 | icd->ops = NULL; |
923 | - i2c_set_clientdata(client, NULL); | |
924 | 923 | kfree(mt9v022); |
925 | 924 | } |
926 | 925 | |
... | ... | @@ -934,7 +933,6 @@ |
934 | 933 | |
935 | 934 | icd->ops = NULL; |
936 | 935 | mt9v022_video_remove(icd); |
937 | - i2c_set_clientdata(client, NULL); | |
938 | 936 | client->driver = NULL; |
939 | 937 | kfree(mt9v022); |
940 | 938 |
drivers/media/video/ov772x.c
... | ... | @@ -1159,7 +1159,6 @@ |
1159 | 1159 | ret = ov772x_video_probe(icd, client); |
1160 | 1160 | if (ret) { |
1161 | 1161 | icd->ops = NULL; |
1162 | - i2c_set_clientdata(client, NULL); | |
1163 | 1162 | kfree(priv); |
1164 | 1163 | } |
1165 | 1164 | |
... | ... | @@ -1172,7 +1171,6 @@ |
1172 | 1171 | struct soc_camera_device *icd = client->dev.platform_data; |
1173 | 1172 | |
1174 | 1173 | icd->ops = NULL; |
1175 | - i2c_set_clientdata(client, NULL); | |
1176 | 1174 | kfree(priv); |
1177 | 1175 | return 0; |
1178 | 1176 | } |
drivers/media/video/ov9640.c
... | ... | @@ -783,7 +783,6 @@ |
783 | 783 | |
784 | 784 | if (ret) { |
785 | 785 | icd->ops = NULL; |
786 | - i2c_set_clientdata(client, NULL); | |
787 | 786 | kfree(priv); |
788 | 787 | } |
789 | 788 | |
... | ... | @@ -794,7 +793,6 @@ |
794 | 793 | { |
795 | 794 | struct ov9640_priv *priv = i2c_get_clientdata(client); |
796 | 795 | |
797 | - i2c_set_clientdata(client, NULL); | |
798 | 796 | kfree(priv); |
799 | 797 | return 0; |
800 | 798 | } |
drivers/media/video/rj54n1cb0c.c
... | ... | @@ -1444,7 +1444,6 @@ |
1444 | 1444 | ret = rj54n1_video_probe(icd, client, rj54n1_priv); |
1445 | 1445 | if (ret < 0) { |
1446 | 1446 | icd->ops = NULL; |
1447 | - i2c_set_clientdata(client, NULL); | |
1448 | 1447 | kfree(rj54n1); |
1449 | 1448 | return ret; |
1450 | 1449 | } |
... | ... | @@ -1461,7 +1460,6 @@ |
1461 | 1460 | icd->ops = NULL; |
1462 | 1461 | if (icl->free_bus) |
1463 | 1462 | icl->free_bus(icl); |
1464 | - i2c_set_clientdata(client, NULL); | |
1465 | 1463 | client->driver = NULL; |
1466 | 1464 | kfree(rj54n1); |
1467 | 1465 |
drivers/media/video/tcm825x.c
... | ... | @@ -850,7 +850,6 @@ |
850 | 850 | const struct i2c_device_id *did) |
851 | 851 | { |
852 | 852 | struct tcm825x_sensor *sensor = &tcm825x; |
853 | - int rval; | |
854 | 853 | |
855 | 854 | if (i2c_get_clientdata(client)) |
856 | 855 | return -EBUSY; |
... | ... | @@ -871,11 +870,7 @@ |
871 | 870 | sensor->pix.height = tcm825x_sizes[QVGA].height; |
872 | 871 | sensor->pix.pixelformat = V4L2_PIX_FMT_RGB565; |
873 | 872 | |
874 | - rval = v4l2_int_device_register(sensor->v4l2_int_device); | |
875 | - if (rval) | |
876 | - i2c_set_clientdata(client, NULL); | |
877 | - | |
878 | - return rval; | |
873 | + return v4l2_int_device_register(sensor->v4l2_int_device); | |
879 | 874 | } |
880 | 875 | |
881 | 876 | static int tcm825x_remove(struct i2c_client *client) |
... | ... | @@ -886,7 +881,6 @@ |
886 | 881 | return -ENODEV; /* our client isn't attached */ |
887 | 882 | |
888 | 883 | v4l2_int_device_unregister(sensor->v4l2_int_device); |
889 | - i2c_set_clientdata(client, NULL); | |
890 | 884 | |
891 | 885 | return 0; |
892 | 886 | } |
drivers/media/video/tw9910.c
... | ... | @@ -977,7 +977,6 @@ |
977 | 977 | ret = tw9910_video_probe(icd, client); |
978 | 978 | if (ret) { |
979 | 979 | icd->ops = NULL; |
980 | - i2c_set_clientdata(client, NULL); | |
981 | 980 | kfree(priv); |
982 | 981 | } |
983 | 982 | |
... | ... | @@ -990,7 +989,6 @@ |
990 | 989 | struct soc_camera_device *icd = client->dev.platform_data; |
991 | 990 | |
992 | 991 | icd->ops = NULL; |
993 | - i2c_set_clientdata(client, NULL); | |
994 | 992 | kfree(priv); |
995 | 993 | return 0; |
996 | 994 | } |
drivers/mfd/88pm860x-i2c.c
drivers/mfd/ab3100-core.c
... | ... | @@ -957,7 +957,6 @@ |
957 | 957 | i2c_unregister_device(ab3100->testreg_client); |
958 | 958 | exit_no_testreg_client: |
959 | 959 | exit_no_detect: |
960 | - i2c_set_clientdata(client, NULL); | |
961 | 960 | kfree(ab3100); |
962 | 961 | return err; |
963 | 962 | } |
... | ... | @@ -979,7 +978,6 @@ |
979 | 978 | * their notifiers so deactivate IRQ |
980 | 979 | */ |
981 | 980 | free_irq(client->irq, ab3100); |
982 | - i2c_set_clientdata(client, NULL); | |
983 | 981 | kfree(ab3100); |
984 | 982 | return 0; |
985 | 983 | } |
drivers/mfd/ab3550-core.c
drivers/mfd/adp5520.c
... | ... | @@ -302,7 +302,6 @@ |
302 | 302 | free_irq(chip->irq, chip); |
303 | 303 | |
304 | 304 | out_free_chip: |
305 | - i2c_set_clientdata(client, NULL); | |
306 | 305 | kfree(chip); |
307 | 306 | |
308 | 307 | return ret; |
... | ... | @@ -317,7 +316,6 @@ |
317 | 316 | |
318 | 317 | adp5520_remove_subdevs(chip); |
319 | 318 | adp5520_write(chip->dev, ADP5520_MODE_STATUS, 0); |
320 | - i2c_set_clientdata(client, NULL); | |
321 | 319 | kfree(chip); |
322 | 320 | return 0; |
323 | 321 | } |
drivers/mfd/da903x.c
... | ... | @@ -534,7 +534,6 @@ |
534 | 534 | out_free_irq: |
535 | 535 | free_irq(client->irq, chip); |
536 | 536 | out_free_chip: |
537 | - i2c_set_clientdata(client, NULL); | |
538 | 537 | kfree(chip); |
539 | 538 | return ret; |
540 | 539 | } |
... | ... | @@ -544,7 +543,6 @@ |
544 | 543 | struct da903x_chip *chip = i2c_get_clientdata(client); |
545 | 544 | |
546 | 545 | da903x_remove_subdevs(chip); |
547 | - i2c_set_clientdata(client, NULL); | |
548 | 546 | kfree(chip); |
549 | 547 | return 0; |
550 | 548 | } |
drivers/mfd/max8925-i2c.c
drivers/mfd/menelaus.c
... | ... | @@ -1228,7 +1228,6 @@ |
1228 | 1228 | free_irq(client->irq, menelaus); |
1229 | 1229 | flush_scheduled_work(); |
1230 | 1230 | fail1: |
1231 | - i2c_set_clientdata(client, NULL); | |
1232 | 1231 | kfree(menelaus); |
1233 | 1232 | return err; |
1234 | 1233 | } |
... | ... | @@ -1238,7 +1237,6 @@ |
1238 | 1237 | struct menelaus_chip *menelaus = i2c_get_clientdata(client); |
1239 | 1238 | |
1240 | 1239 | free_irq(client->irq, menelaus); |
1241 | - i2c_set_clientdata(client, NULL); | |
1242 | 1240 | kfree(menelaus); |
1243 | 1241 | the_menelaus = NULL; |
1244 | 1242 | return 0; |
drivers/mfd/pcf50633-core.c
... | ... | @@ -336,7 +336,6 @@ |
336 | 336 | return 0; |
337 | 337 | |
338 | 338 | err_free: |
339 | - i2c_set_clientdata(client, NULL); | |
340 | 339 | kfree(pcf); |
341 | 340 | |
342 | 341 | return ret; |
... | ... | @@ -357,7 +356,6 @@ |
357 | 356 | for (i = 0; i < PCF50633_NUM_REGULATORS; i++) |
358 | 357 | platform_device_unregister(pcf->regulator_pdev[i]); |
359 | 358 | |
360 | - i2c_set_clientdata(client, NULL); | |
361 | 359 | kfree(pcf); |
362 | 360 | |
363 | 361 | return 0; |
drivers/mfd/tc35892.c
... | ... | @@ -296,7 +296,6 @@ |
296 | 296 | out_removeirq: |
297 | 297 | tc35892_irq_remove(tc35892); |
298 | 298 | out_free: |
299 | - i2c_set_clientdata(i2c, NULL); | |
300 | 299 | kfree(tc35892); |
301 | 300 | return ret; |
302 | 301 | } |
... | ... | @@ -310,7 +309,6 @@ |
310 | 309 | free_irq(tc35892->i2c->irq, tc35892); |
311 | 310 | tc35892_irq_remove(tc35892); |
312 | 311 | |
313 | - i2c_set_clientdata(client, NULL); | |
314 | 312 | kfree(tc35892); |
315 | 313 | |
316 | 314 | return 0; |
drivers/mfd/tps65010.c
drivers/mfd/wm8350-i2c.c
... | ... | @@ -80,7 +80,6 @@ |
80 | 80 | return ret; |
81 | 81 | |
82 | 82 | err: |
83 | - i2c_set_clientdata(i2c, NULL); | |
84 | 83 | kfree(wm8350); |
85 | 84 | return ret; |
86 | 85 | } |
... | ... | @@ -90,7 +89,6 @@ |
90 | 89 | struct wm8350 *wm8350 = i2c_get_clientdata(i2c); |
91 | 90 | |
92 | 91 | wm8350_device_exit(wm8350); |
93 | - i2c_set_clientdata(i2c, NULL); | |
94 | 92 | kfree(wm8350); |
95 | 93 | |
96 | 94 | return 0; |
drivers/mfd/wm8400-core.c
... | ... | @@ -415,7 +415,6 @@ |
415 | 415 | return 0; |
416 | 416 | |
417 | 417 | struct_err: |
418 | - i2c_set_clientdata(i2c, NULL); | |
419 | 418 | kfree(wm8400); |
420 | 419 | err: |
421 | 420 | return ret; |
... | ... | @@ -426,7 +425,6 @@ |
426 | 425 | struct wm8400 *wm8400 = i2c_get_clientdata(i2c); |
427 | 426 | |
428 | 427 | wm8400_release(wm8400); |
429 | - i2c_set_clientdata(i2c, NULL); | |
430 | 428 | kfree(wm8400); |
431 | 429 | |
432 | 430 | return 0; |
drivers/misc/eeprom/at24.c
drivers/mtd/maps/pismo.c
... | ... | @@ -234,7 +234,6 @@ |
234 | 234 | /* FIXME: set_vpp needs saner arguments */ |
235 | 235 | pismo_setvpp_remove_fix(pismo); |
236 | 236 | |
237 | - i2c_set_clientdata(client, NULL); | |
238 | 237 | kfree(pismo); |
239 | 238 | |
240 | 239 | return 0; |
... | ... | @@ -286,7 +285,6 @@ |
286 | 285 | return 0; |
287 | 286 | |
288 | 287 | exit_free: |
289 | - i2c_set_clientdata(client, NULL); | |
290 | 288 | kfree(pismo); |
291 | 289 | return ret; |
292 | 290 | } |
drivers/power/max17040_battery.c
... | ... | @@ -225,7 +225,6 @@ |
225 | 225 | ret = power_supply_register(&client->dev, &chip->battery); |
226 | 226 | if (ret) { |
227 | 227 | dev_err(&client->dev, "failed: power supply register\n"); |
228 | - i2c_set_clientdata(client, NULL); | |
229 | 228 | kfree(chip); |
230 | 229 | return ret; |
231 | 230 | } |
... | ... | @@ -245,7 +244,6 @@ |
245 | 244 | |
246 | 245 | power_supply_unregister(&chip->battery); |
247 | 246 | cancel_delayed_work(&chip->work); |
248 | - i2c_set_clientdata(client, NULL); | |
249 | 247 | kfree(chip); |
250 | 248 | return 0; |
251 | 249 | } |
drivers/regulator/lp3971.c
drivers/regulator/max1586.c
drivers/regulator/max8649.c
... | ... | @@ -357,7 +357,6 @@ |
357 | 357 | dev_info(info->dev, "Max8649 regulator device is detected.\n"); |
358 | 358 | return 0; |
359 | 359 | out: |
360 | - i2c_set_clientdata(client, NULL); | |
361 | 360 | kfree(info); |
362 | 361 | return ret; |
363 | 362 | } |
... | ... | @@ -369,7 +368,6 @@ |
369 | 368 | if (info) { |
370 | 369 | if (info->regulator) |
371 | 370 | regulator_unregister(info->regulator); |
372 | - i2c_set_clientdata(client, NULL); | |
373 | 371 | kfree(info); |
374 | 372 | } |
375 | 373 |
drivers/regulator/max8660.c
drivers/regulator/tps65023-regulator.c
... | ... | @@ -538,9 +538,6 @@ |
538 | 538 | struct tps_pmic *tps = i2c_get_clientdata(client); |
539 | 539 | int i; |
540 | 540 | |
541 | - /* clear the client data in i2c */ | |
542 | - i2c_set_clientdata(client, NULL); | |
543 | - | |
544 | 541 | for (i = 0; i < TPS65023_NUM_REGULATOR; i++) |
545 | 542 | regulator_unregister(tps->rdev[i]); |
546 | 543 |
drivers/rtc/rtc-ds1374.c
... | ... | @@ -403,7 +403,6 @@ |
403 | 403 | free_irq(client->irq, client); |
404 | 404 | |
405 | 405 | out_free: |
406 | - i2c_set_clientdata(client, NULL); | |
407 | 406 | kfree(ds1374); |
408 | 407 | return ret; |
409 | 408 | } |
... | ... | @@ -422,7 +421,6 @@ |
422 | 421 | } |
423 | 422 | |
424 | 423 | rtc_device_unregister(ds1374->rtc); |
425 | - i2c_set_clientdata(client, NULL); | |
426 | 424 | kfree(ds1374); |
427 | 425 | return 0; |
428 | 426 | } |
drivers/rtc/rtc-rx8025.c
... | ... | @@ -632,7 +632,6 @@ |
632 | 632 | rtc_device_unregister(rx8025->rtc); |
633 | 633 | |
634 | 634 | errout_free: |
635 | - i2c_set_clientdata(client, NULL); | |
636 | 635 | kfree(rx8025); |
637 | 636 | |
638 | 637 | errout: |
... | ... | @@ -656,7 +655,6 @@ |
656 | 655 | |
657 | 656 | rx8025_sysfs_unregister(&client->dev); |
658 | 657 | rtc_device_unregister(rx8025->rtc); |
659 | - i2c_set_clientdata(client, NULL); | |
660 | 658 | kfree(rx8025); |
661 | 659 | return 0; |
662 | 660 | } |
drivers/rtc/rtc-s35390a.c
... | ... | @@ -275,7 +275,6 @@ |
275 | 275 | if (s35390a->client[i]) |
276 | 276 | i2c_unregister_device(s35390a->client[i]); |
277 | 277 | kfree(s35390a); |
278 | - i2c_set_clientdata(client, NULL); | |
279 | 278 | |
280 | 279 | exit: |
281 | 280 | return err; |
... | ... | @@ -292,7 +291,6 @@ |
292 | 291 | |
293 | 292 | rtc_device_unregister(s35390a->rtc); |
294 | 293 | kfree(s35390a); |
295 | - i2c_set_clientdata(client, NULL); | |
296 | 294 | |
297 | 295 | return 0; |
298 | 296 | } |
drivers/staging/dream/synaptics_i2c_rmi.c
... | ... | @@ -519,7 +519,6 @@ |
519 | 519 | err_input_dev_alloc_failed: |
520 | 520 | err_detect_failed: |
521 | 521 | err_power_failed: |
522 | - i2c_set_clientdata(client, NULL); | |
523 | 522 | kfree(ts); |
524 | 523 | err_alloc_data_failed: |
525 | 524 | err_check_functionality_failed: |
... | ... | @@ -537,7 +536,6 @@ |
537 | 536 | else |
538 | 537 | hrtimer_cancel(&ts->timer); |
539 | 538 | input_unregister_device(ts->input_dev); |
540 | - i2c_set_clientdata(client, NULL); | |
541 | 539 | kfree(ts); |
542 | 540 | return 0; |
543 | 541 | } |
drivers/staging/go7007/wis-saa7113.c
... | ... | @@ -289,7 +289,6 @@ |
289 | 289 | if (write_regs(client, initial_registers) < 0) { |
290 | 290 | printk(KERN_ERR |
291 | 291 | "wis-saa7113: error initializing SAA7113\n"); |
292 | - i2c_set_clientdata(client, NULL); | |
293 | 292 | kfree(dec); |
294 | 293 | return -ENODEV; |
295 | 294 | } |
... | ... | @@ -301,7 +300,6 @@ |
301 | 300 | { |
302 | 301 | struct wis_saa7113 *dec = i2c_get_clientdata(client); |
303 | 302 | |
304 | - i2c_set_clientdata(client, NULL); | |
305 | 303 | kfree(dec); |
306 | 304 | return 0; |
307 | 305 | } |
drivers/staging/go7007/wis-saa7115.c
... | ... | @@ -422,7 +422,6 @@ |
422 | 422 | if (write_regs(client, initial_registers) < 0) { |
423 | 423 | printk(KERN_ERR |
424 | 424 | "wis-saa7115: error initializing SAA7115\n"); |
425 | - i2c_set_clientdata(client, NULL); | |
426 | 425 | kfree(dec); |
427 | 426 | return -ENODEV; |
428 | 427 | } |
... | ... | @@ -434,7 +433,6 @@ |
434 | 433 | { |
435 | 434 | struct wis_saa7115 *dec = i2c_get_clientdata(client); |
436 | 435 | |
437 | - i2c_set_clientdata(client, NULL); | |
438 | 436 | kfree(dec); |
439 | 437 | return 0; |
440 | 438 | } |
drivers/staging/go7007/wis-sony-tuner.c
drivers/staging/go7007/wis-tw2804.c
drivers/staging/go7007/wis-tw9903.c
... | ... | @@ -294,7 +294,6 @@ |
294 | 294 | |
295 | 295 | if (write_regs(client, initial_registers) < 0) { |
296 | 296 | printk(KERN_ERR "wis-tw9903: error initializing TW9903\n"); |
297 | - i2c_set_clientdata(client, NULL); | |
298 | 297 | kfree(dec); |
299 | 298 | return -ENODEV; |
300 | 299 | } |
... | ... | @@ -306,7 +305,6 @@ |
306 | 305 | { |
307 | 306 | struct wis_tw9903 *dec = i2c_get_clientdata(client); |
308 | 307 | |
309 | - i2c_set_clientdata(client, NULL); | |
310 | 308 | kfree(dec); |
311 | 309 | return 0; |
312 | 310 | } |
drivers/staging/iio/adc/max1363_core.c
... | ... | @@ -1011,7 +1011,6 @@ |
1011 | 1011 | if (!IS_ERR(st->reg)) |
1012 | 1012 | regulator_put(st->reg); |
1013 | 1013 | error_free_st: |
1014 | - i2c_set_clientdata(client, NULL); | |
1015 | 1014 | kfree(st); |
1016 | 1015 | |
1017 | 1016 | error_ret: |
... | ... | @@ -1030,7 +1029,6 @@ |
1030 | 1029 | regulator_disable(st->reg); |
1031 | 1030 | regulator_put(st->reg); |
1032 | 1031 | } |
1033 | - i2c_set_clientdata(client, NULL); | |
1034 | 1032 | kfree(st); |
1035 | 1033 | |
1036 | 1034 | return 0; |
drivers/staging/iio/light/tsl2563.c
... | ... | @@ -694,7 +694,6 @@ |
694 | 694 | fail2: |
695 | 695 | iio_device_unregister(chip->indio_dev); |
696 | 696 | fail1: |
697 | - i2c_set_clientdata(client, NULL); | |
698 | 697 | kfree(chip); |
699 | 698 | return err; |
700 | 699 | } |
... | ... | @@ -705,7 +704,6 @@ |
705 | 704 | |
706 | 705 | iio_device_unregister(chip->indio_dev); |
707 | 706 | |
708 | - i2c_set_clientdata(client, NULL); | |
709 | 707 | kfree(chip); |
710 | 708 | return 0; |
711 | 709 | } |
drivers/video/backlight/adp8860_bl.c
... | ... | @@ -756,7 +756,6 @@ |
756 | 756 | out1: |
757 | 757 | backlight_device_unregister(bl); |
758 | 758 | out2: |
759 | - i2c_set_clientdata(client, NULL); | |
760 | 759 | kfree(data); |
761 | 760 | |
762 | 761 | return ret; |
... | ... | @@ -776,7 +775,6 @@ |
776 | 775 | &adp8860_bl_attr_group); |
777 | 776 | |
778 | 777 | backlight_device_unregister(data->bl); |
779 | - i2c_set_clientdata(client, NULL); | |
780 | 778 | kfree(data); |
781 | 779 | |
782 | 780 | return 0; |
drivers/video/backlight/tosa_bl.c
... | ... | @@ -119,7 +119,6 @@ |
119 | 119 | |
120 | 120 | err_reg: |
121 | 121 | data->bl = NULL; |
122 | - i2c_set_clientdata(client, NULL); | |
123 | 122 | err_gpio_dir: |
124 | 123 | gpio_free(TOSA_GPIO_BL_C20MA); |
125 | 124 | err_gpio_bl: |
... | ... | @@ -133,7 +132,6 @@ |
133 | 132 | |
134 | 133 | backlight_device_unregister(data->bl); |
135 | 134 | data->bl = NULL; |
136 | - i2c_set_clientdata(client, NULL); | |
137 | 135 | |
138 | 136 | gpio_free(TOSA_GPIO_BL_C20MA); |
139 | 137 |