]> bbs.cooldavid.org Git - net-next-2.6.git/commitdiff
Merge branch 'i2c-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jdelvar...
authorLinus Torvalds <torvalds@linux-foundation.org>
Thu, 3 Jun 2010 22:44:43 +0000 (15:44 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 3 Jun 2010 22:44:43 +0000 (15:44 -0700)
* 'i2c-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jdelvare/staging:
  i2c: Remove all i2c_set_clientdata(client, NULL) in drivers
  i2c/busses: Move two drivers to embedded section
  i2c: Rename i2c_check_addr to i2c_check_addr_busy
  i2c: Document reserved I2C addresses
  i2c: Check for address validity on client registration
  i2c: Share the I2C device presence detection code
  Documentation/i2c: Checkpatch cleanup

85 files changed:
Documentation/i2c/busses/i2c-ali1535
Documentation/i2c/busses/i2c-ali1563
Documentation/i2c/busses/i2c-ali15x3
Documentation/i2c/busses/i2c-pca-isa
Documentation/i2c/busses/i2c-sis5595
Documentation/i2c/busses/i2c-sis630
Documentation/i2c/ten-bit-addresses
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/busses/Kconfig
drivers/i2c/busses/Makefile
drivers/i2c/i2c-core.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

index 0db3b4c74ad11109ac59e1486388b5675d49bc56..acbc65a08097777c41d5e400602bde9ed04ae160 100644 (file)
@@ -6,12 +6,12 @@ Supported adapters:
        http://www.ali.com.tw/eng/support/datasheet_request.php
 
 Authors:
-       Frodo Looijaard <frodol@dds.nl>, 
+       Frodo Looijaard <frodol@dds.nl>,
        Philip Edelbrock <phil@netroedge.com>,
        Mark D. Studebaker <mdsxyz123@yahoo.com>,
        Dan Eaton <dan.eaton@rocketlogix.com>,
        Stephen Rousset<stephen.rousset@rocketlogix.com>
-                                                                                               
+
 Description
 -----------
 
index 99ad4b9bcc32ec945235298ee1b9ffd8fbaa3e69..54691698d2ddd465f2a5e9ecd7a1e99ae1da57e5 100644 (file)
@@ -18,7 +18,7 @@ For an overview of these chips see http://www.acerlabs.com
 The M1563 southbridge is deceptively similar to the M1533, with a few
 notable exceptions. One of those happens to be the fact they upgraded the
 i2c core to be SMBus 2.0 compliant, and happens to be almost identical to
-the i2c controller found in the Intel 801 south bridges. 
+the i2c controller found in the Intel 801 south bridges.
 
 Features
 --------
index ff28d381bebe8daa880e344c767e4dad7ff4be14..600da90b8f12138fbf0bd5eb78c2bf0922317443 100644 (file)
@@ -6,8 +6,8 @@ Supported adapters:
        http://www.ali.com.tw/eng/support/datasheet_request.php
 
 Authors:
-       Frodo Looijaard <frodol@dds.nl>, 
-       Philip Edelbrock <phil@netroedge.com>, 
+       Frodo Looijaard <frodol@dds.nl>,
+       Philip Edelbrock <phil@netroedge.com>,
        Mark D. Studebaker <mdsxyz123@yahoo.com>
 
 Module Parameters
@@ -40,10 +40,10 @@ M1541 and M1543C South Bridges.
 The M1543C is a South bridge for desktop systems.
 The M1541 is a South bridge for portable systems.
 They are part of the following ALI chipsets:
-   
- * "Aladdin Pro 2" includes the M1621 Slot 1 North bridge with AGP and 
+
+ * "Aladdin Pro 2" includes the M1621 Slot 1 North bridge with AGP and
                100MHz CPU Front Side bus
- * "Aladdin V" includes the M1541 Socket 7 North bridge with AGP and 100MHz 
+ * "Aladdin V" includes the M1541 Socket 7 North bridge with AGP and 100MHz
                CPU Front Side bus
    Some Aladdin V motherboards:
        Asus P5A
@@ -77,7 +77,7 @@ output of lspci will show something similar to the following:
 ** then run lspci.
 ** If you see the 1533 and 5229 devices but NOT the 7101 device,
 ** then you must enable ACPI, the PMU, SMB, or something similar
-** in the BIOS. 
+** in the BIOS.
 ** The driver won't work if it can't find the M7101 device.
 
 The SMB controller is part of the M7101 device, which is an ACPI-compliant
@@ -87,8 +87,8 @@ The whole M7101 device has to be enabled for the SMB to work. You can't
 just enable the SMB alone. The SMB and the ACPI have separate I/O spaces.
 We make sure that the SMB is enabled. We leave the ACPI alone.
 
-Features 
--------- 
+Features
+--------
 
 This driver controls the SMB Host only. The SMB Slave
 controller on the M15X3 is not enabled. This driver does not use
index 6fc8f4c27c3ce58a12470e11efed3435dede8d85..b044e52654886c05dd37d16212a4cd2cf80419a3 100644 (file)
@@ -1,10 +1,10 @@
 Kernel driver i2c-pca-isa
 
 Supported adapters:
-This driver supports ISA boards using the Philips PCA 9564 
-Parallel bus to I2C bus controller 
+This driver supports ISA boards using the Philips PCA 9564
+Parallel bus to I2C bus controller
 
-Author: Ian Campbell <icampbell@arcom.com>, Arcom Control Systems 
+Author: Ian Campbell <icampbell@arcom.com>, Arcom Control Systems
 
 Module Parameters
 -----------------
@@ -12,12 +12,12 @@ Module Parameters
 * base int
  I/O base address
 * irq int
- IRQ interrupt 
-* clock int 
+ IRQ interrupt
+* clock int
  Clock rate as described in table 1 of PCA9564 datasheet
 
 Description
 -----------
 
-This driver supports ISA boards using the Philips PCA 9564 
-Parallel bus to I2C bus controller 
+This driver supports ISA boards using the Philips PCA 9564
+Parallel bus to I2C bus controller
index cc47db7d00a989da91f6cf99b1578a76ff7cc577..ecd21fb49a8f0c7cd780def05f3ca5408983c3c5 100644 (file)
@@ -1,41 +1,41 @@
 Kernel driver i2c-sis5595
 
-Authors: 
+Authors:
        Frodo Looijaard <frodol@dds.nl>,
         Mark D. Studebaker <mdsxyz123@yahoo.com>,
-       Philip Edelbrock <phil@netroedge.com> 
+       Philip Edelbrock <phil@netroedge.com>
 
 Supported adapters:
   * Silicon Integrated Systems Corp. SiS5595 Southbridge
     Datasheet: Publicly available at the Silicon Integrated Systems Corp. site.
 
-Note: all have mfr. ID 0x1039. 
-
-   SUPPORTED            PCI ID           
-        5595            0008 
-   Note: these chips contain a 0008 device which is incompatible with the 
-         5595. We recognize these by the presence of the listed 
-         "blacklist" PCI ID and refuse to load. 
-   NOT SUPPORTED        PCI ID          BLACKLIST PCI ID         
-         540            0008            0540 
-         550            0008            0550 
-        5513            0008            5511 
-        5581            0008            5597 
-        5582            0008            5597 
-        5597            0008            5597 
-        5598            0008            5597/5598 
-         630            0008            0630 
-         645            0008            0645 
-         646            0008            0646 
-         648            0008            0648 
-         650            0008            0650 
-         651            0008            0651 
-         730            0008            0730 
-         735            0008            0735 
-         745            0008            0745 
-         746            0008            0746 
+Note: all have mfr. ID 0x1039.
+
+   SUPPORTED            PCI ID
+        5595            0008
+
+   Note: these chips contain a 0008 device which is incompatible with the
+         5595. We recognize these by the presence of the listed
+         "blacklist" PCI ID and refuse to load.
+
+   NOT SUPPORTED        PCI ID          BLACKLIST PCI ID
+         540            0008            0540
+         550            0008            0550
+        5513            0008            5511
+        5581            0008            5597
+        5582            0008            5597
+        5597            0008            5597
+        5598            0008            5597/5598
+         630            0008            0630
+         645            0008            0645
+         646            0008            0646
+         648            0008            0648
+         650            0008            0650
+         651            0008            0651
+         730            0008            0730
+         735            0008            0735
+         745            0008            0745
+         746            0008            0746
 
 Module Parameters
 -----------------
index 9aca6889f748e2479052c5c42e9144f852ea42b7..629ea2c356fdb1d00594f57865cbe148c283ee82 100644 (file)
@@ -14,9 +14,9 @@ Module Parameters
 * force = [1|0] Forcibly enable the SIS630. DANGEROUS!
                This can be interesting for chipsets not named
                above to check if it works for you chipset, but DANGEROUS!
-               
-* high_clock = [1|0] Forcibly set Host Master Clock to 56KHz (default, 
-                       what your BIOS use). DANGEROUS! This should be a bit 
+
+* high_clock = [1|0] Forcibly set Host Master Clock to 56KHz (default,
+                       what your BIOS use). DANGEROUS! This should be a bit
                        faster, but freeze some systems (i.e. my Laptop).
 
 
@@ -44,6 +44,6 @@ Philip Edelbrock <phil@netroedge.com>
 - testing SiS730 support
 Mark M. Hoffman <mhoffman@lightlink.com>
 - bug fixes
+
 To anyone else which I forgot here ;), thanks!
 
index 200074f8136073bf988463272e0ea269020ac980..e9890709c508b25ed9878ab979797d1fc58a7a4b 100644 (file)
@@ -1,17 +1,17 @@
-The I2C protocol knows about two kinds of device addresses: normal 7 bit 
+The I2C protocol knows about two kinds of device addresses: normal 7 bit
 addresses, and an extended set of 10 bit addresses. The sets of addresses
 do not intersect: the 7 bit address 0x10 is not the same as the 10 bit
 address 0x10 (though a single device could respond to both of them). You
 select a 10 bit address by adding an extra byte after the address
 byte:
-  S Addr7 Rd/Wr ....  
+  S Addr7 Rd/Wr ....
 becomes
   S 11110 Addr10 Rd/Wr
 S is the start bit, Rd/Wr the read/write bit, and if you count the number
 of bits, you will see the there are 8 after the S bit for 7 bit addresses,
 and 16 after the S bit for 10 bit addresses.
 
-WARNING! The current 10 bit address support is EXPERIMENTAL. There are 
+WARNING! The current 10 bit address support is EXPERIMENTAL. There are
 several places in the code that will cause SEVERE PROBLEMS with 10 bit
 addresses, even though there is some basic handling and hooks. Also,
 almost no supported adapter handles the 10 bit addresses correctly.
index 4086c7257f912f23608c261f1b29f68b3c04a602..f13c843a2964bbb07728c06363cda065937293bb 100644 (file)
@@ -316,7 +316,6 @@ static int __devinit adt7411_probe(struct i2c_client *client,
  exit_remove:
        sysfs_remove_group(&client->dev.kobj, &adt7411_attr_grp);
  exit_free:
-       i2c_set_clientdata(client, NULL);
        kfree(data);
        return ret;
 }
@@ -327,7 +326,6 @@ static int __devexit adt7411_remove(struct i2c_client *client)
 
        hwmon_device_unregister(data->hwmon_dev);
        sysfs_remove_group(&client->dev.kobj, &adt7411_attr_grp);
-       i2c_set_clientdata(client, NULL);
        kfree(data);
        return 0;
 }
index 0f388adc61876cc3f0481de786289d724b1977a6..3b973f30b1f6495a89029b4002816ee8ff299353 100644 (file)
@@ -1141,7 +1141,6 @@ exit_remove:
                                   &(asc7621_params[i].sda.dev_attr));
        }
 
-       i2c_set_clientdata(client, NULL);
        kfree(data);
        return err;
 }
@@ -1196,7 +1195,6 @@ static int asc7621_remove(struct i2c_client *client)
                                   &(asc7621_params[i].sda.dev_attr));
        }
 
-       i2c_set_clientdata(client, NULL);
        kfree(data);
        return 0;
 }
index bad2cf3ef4a448aa76a72033b527647c6434f9d3..0f58ecc5334d941cb4114a3681e2e5a44893280e 100644 (file)
@@ -662,7 +662,6 @@ exit_remove:
        sysfs_remove_group(&client->dev.kobj, &f75375_group);
 exit_free:
        kfree(data);
-       i2c_set_clientdata(client, NULL);
        return err;
 }
 
@@ -672,7 +671,6 @@ static int f75375_remove(struct i2c_client *client)
        hwmon_device_unregister(data->hwmon_dev);
        sysfs_remove_group(&client->dev.kobj, &f75375_group);
        kfree(data);
-       i2c_set_clientdata(client, NULL);
        return 0;
 }
 
index 09ea12e0a55185b3e5d0699cf7922898752b70af..1f63d1a3af5ebc4aae1d31f18d505881273b8a65 100644 (file)
@@ -236,7 +236,6 @@ error_hwmon_device_register:
        sysfs_remove_group(&client->dev.kobj, &g760a_group);
 error_sysfs_create_group:
        kfree(data);
-       i2c_set_clientdata(client, NULL);
 
        return err;
 }
@@ -247,7 +246,6 @@ static int g760a_remove(struct i2c_client *client)
        hwmon_device_unregister(data->hwmon_dev);
        sysfs_remove_group(&client->dev.kobj, &g760a_group);
        kfree(data);
-       i2c_set_clientdata(client, NULL);
 
        return 0;
 }
index 4d1b76bc81486b64dc6963d8ee415c2608c0fb82..29b9030d42c3111ecfdc49cc2a9cbf8aa4257cd6 100644 (file)
@@ -136,7 +136,6 @@ static int lm73_remove(struct i2c_client *client)
 
        hwmon_device_unregister(hwmon_dev);
        sysfs_remove_group(&client->dev.kobj, &lm73_group);
-       i2c_set_clientdata(client, NULL);
        return 0;
 }
 
index 56463428a419ce8f4222f5504b96f57cd44503fd..393f354f92a4c012c46ee96a8062f7b604697cdf 100644 (file)
@@ -192,7 +192,6 @@ lm75_probe(struct i2c_client *client, const struct i2c_device_id *id)
 exit_remove:
        sysfs_remove_group(&client->dev.kobj, &lm75_group);
 exit_free:
-       i2c_set_clientdata(client, NULL);
        kfree(data);
        return status;
 }
@@ -204,7 +203,6 @@ static int lm75_remove(struct i2c_client *client)
        hwmon_device_unregister(data->hwmon_dev);
        sysfs_remove_group(&client->dev.kobj, &lm75_group);
        lm75_write_value(client, LM75_REG_CONF, data->orig_conf);
-       i2c_set_clientdata(client, NULL);
        kfree(data);
        return 0;
 }
index 8fc8eb8cba47400fd23614a392b135949aab8c76..94741d42112da02ca902b2e87beacbe96aab3cd3 100644 (file)
@@ -399,7 +399,6 @@ static int lm95241_remove(struct i2c_client *client)
        hwmon_device_unregister(data->hwmon_dev);
        sysfs_remove_group(&client->dev.kobj, &lm95241_group);
 
-       i2c_set_clientdata(client, NULL);
        kfree(data);
        return 0;
 }
index 8013895a1fafc19918faca9b838be7b4dc58d581..93187c3cb5e7949a72b5599bb127fce61701ec49 100644 (file)
@@ -224,7 +224,6 @@ fail_remove_sysfs:
 fail_restore_config:
        tmp102_write_reg(client, TMP102_CONF_REG, tmp102->config_orig);
 fail_free:
-       i2c_set_clientdata(client, NULL);
        kfree(tmp102);
 
        return status;
@@ -247,7 +246,6 @@ static int __devexit tmp102_remove(struct i2c_client *client)
                                         config | TMP102_CONF_SD);
        }
 
-       i2c_set_clientdata(client, NULL);
        kfree(tmp102);
 
        return 0;
index 738c472ece273bf972b1206e9b164b88d046b0bc..6b4165c12092b388c365824c49c8c7d6a65c9a8c 100644 (file)
@@ -295,7 +295,6 @@ exit_remove:
        sysfs_remove_group(&client->dev.kobj, &tmp421_group);
 
 exit_free:
-       i2c_set_clientdata(client, NULL);
        kfree(data);
 
        return err;
@@ -308,7 +307,6 @@ static int tmp421_remove(struct i2c_client *client)
        hwmon_device_unregister(data->hwmon_dev);
        sysfs_remove_group(&client->dev.kobj, &tmp421_group);
 
-       i2c_set_clientdata(client, NULL);
        kfree(data);
 
        return 0;
index 32d4adee73db650fc5ba2b2cc42586b12b642cd3..c84b9b4e69609e70e55419a6faae4f8f1905a63c 100644 (file)
@@ -1197,7 +1197,6 @@ ERROR4:
        if (data->lm75[1])
                i2c_unregister_device(data->lm75[1]);
 ERROR3:
-       i2c_set_clientdata(client, NULL);
        kfree(data);
 ERROR1:
        return err;
@@ -1219,7 +1218,6 @@ w83781d_remove(struct i2c_client *client)
        if (data->lm75[1])
                i2c_unregister_device(data->lm75[1]);
 
-       i2c_set_clientdata(client, NULL);
        kfree(data);
 
        return 0;
index 87ab0568bb0ed1e18b979b675a5d8db0303ef545..bceafbfa72683698769890bfb664dbe57ea3a010 100644 (file)
@@ -475,6 +475,26 @@ config I2C_PASEMI
        help
          Supports the PA Semi PWRficient on-chip SMBus interfaces.
 
+config I2C_PCA_PLATFORM
+       tristate "PCA9564/PCA9665 as platform device"
+       select I2C_ALGOPCA
+       default n
+       help
+         This driver supports a memory mapped Philips PCA9564/PCA9665
+         parallel bus to I2C bus controller.
+
+         This driver can also be built as a module.  If so, the module
+         will be called i2c-pca-platform.
+
+config I2C_PMCMSP
+       tristate "PMC MSP I2C TWI Controller"
+       depends on PMC_MSP
+       help
+         This driver supports the PMC TWI controller on MSP devices.
+
+         This driver can also be built as module. If so, the module
+         will be called i2c-pmcmsp.
+
 config I2C_PNX
        tristate "I2C bus support for Philips PNX targets"
        depends on ARCH_PNX4008
@@ -711,26 +731,6 @@ config I2C_PCA_ISA
          delays when I2C/SMBus chip drivers are loaded (e.g. at boot
          time).  If unsure, say N.
 
-config I2C_PCA_PLATFORM
-       tristate "PCA9564/PCA9665 as platform device"
-       select I2C_ALGOPCA
-       default n
-       help
-         This driver supports a memory mapped Philips PCA9564/PCA9665
-         parallel bus to I2C bus controller.
-
-         This driver can also be built as a module.  If so, the module
-         will be called i2c-pca-platform.
-
-config I2C_PMCMSP
-       tristate "PMC MSP I2C TWI Controller"
-       depends on PMC_MSP
-       help
-         This driver supports the PMC TWI controller on MSP devices.
-
-         This driver can also be built as module. If so, the module
-         will be called i2c-pmcmsp.
-
 config I2C_SIBYTE
        tristate "SiByte SMBus interface"
        depends on SIBYTE_SB1xxx_SOC
index 097236f631e8d68e57a2ca87562912c995f280ca..936880bd1dc58404d4ed666919939729c7c99585 100644 (file)
@@ -27,7 +27,7 @@ obj-$(CONFIG_I2C_VIAPRO)      += i2c-viapro.o
 obj-$(CONFIG_I2C_HYDRA)                += i2c-hydra.o
 obj-$(CONFIG_I2C_POWERMAC)     += i2c-powermac.o
 
-# Embebbed system I2C/SMBus host controller drivers
+# Embedded system I2C/SMBus host controller drivers
 obj-$(CONFIG_I2C_AT91)         += i2c-at91.o
 obj-$(CONFIG_I2C_AU1550)       += i2c-au1550.o
 obj-$(CONFIG_I2C_BLACKFIN_TWI) += i2c-bfin-twi.o
@@ -46,6 +46,8 @@ obj-$(CONFIG_I2C_NOMADIK)     += i2c-nomadik.o
 obj-$(CONFIG_I2C_OCORES)       += i2c-ocores.o
 obj-$(CONFIG_I2C_OMAP)         += i2c-omap.o
 obj-$(CONFIG_I2C_PASEMI)       += i2c-pasemi.o
+obj-$(CONFIG_I2C_PCA_PLATFORM) += i2c-pca-platform.o
+obj-$(CONFIG_I2C_PMCMSP)       += i2c-pmcmsp.o
 obj-$(CONFIG_I2C_PNX)          += i2c-pnx.o
 obj-$(CONFIG_I2C_PXA)          += i2c-pxa.o
 obj-$(CONFIG_I2C_S3C2410)      += i2c-s3c2410.o
@@ -68,8 +70,6 @@ obj-$(CONFIG_I2C_TINY_USB)    += i2c-tiny-usb.o
 obj-$(CONFIG_I2C_ACORN)                += i2c-acorn.o
 obj-$(CONFIG_I2C_ELEKTOR)      += i2c-elektor.o
 obj-$(CONFIG_I2C_PCA_ISA)      += i2c-pca-isa.o
-obj-$(CONFIG_I2C_PCA_PLATFORM) += i2c-pca-platform.o
-obj-$(CONFIG_I2C_PMCMSP)       += i2c-pmcmsp.o
 obj-$(CONFIG_I2C_SIBYTE)       += i2c-sibyte.o
 obj-$(CONFIG_I2C_STUB)         += i2c-stub.o
 obj-$(CONFIG_SCx200_ACB)       += scx200_acb.o
index e0f833cca3f1193c24480c4efc446a7568a9a3af..1cca2631e5b3bc8331062617a68968006a9fd06e 100644 (file)
@@ -47,7 +47,6 @@ static DEFINE_MUTEX(core_lock);
 static DEFINE_IDR(i2c_adapter_idr);
 
 static struct device_type i2c_client_type;
-static int i2c_check_addr(struct i2c_adapter *adapter, int addr);
 static int i2c_detect(struct i2c_adapter *adapter, struct i2c_driver *driver);
 
 /* ------------------------------------------------------------------------- */
@@ -371,6 +370,59 @@ struct i2c_client *i2c_verify_client(struct device *dev)
 EXPORT_SYMBOL(i2c_verify_client);
 
 
+/* This is a permissive address validity check, I2C address map constraints
+ * are purposedly not enforced, except for the general call address. */
+static int i2c_check_client_addr_validity(const struct i2c_client *client)
+{
+       if (client->flags & I2C_CLIENT_TEN) {
+               /* 10-bit address, all values are valid */
+               if (client->addr > 0x3ff)
+                       return -EINVAL;
+       } else {
+               /* 7-bit address, reject the general call address */
+               if (client->addr == 0x00 || client->addr > 0x7f)
+                       return -EINVAL;
+       }
+       return 0;
+}
+
+/* And this is a strict address validity check, used when probing. If a
+ * device uses a reserved address, then it shouldn't be probed. 7-bit
+ * addressing is assumed, 10-bit address devices are rare and should be
+ * explicitly enumerated. */
+static int i2c_check_addr_validity(unsigned short addr)
+{
+       /*
+        * Reserved addresses per I2C specification:
+        *  0x00       General call address / START byte
+        *  0x01       CBUS address
+        *  0x02       Reserved for different bus format
+        *  0x03       Reserved for future purposes
+        *  0x04-0x07  Hs-mode master code
+        *  0x78-0x7b  10-bit slave addressing
+        *  0x7c-0x7f  Reserved for future purposes
+        */
+       if (addr < 0x08 || addr > 0x77)
+               return -EINVAL;
+       return 0;
+}
+
+static int __i2c_check_addr_busy(struct device *dev, void *addrp)
+{
+       struct i2c_client       *client = i2c_verify_client(dev);
+       int                     addr = *(int *)addrp;
+
+       if (client && client->addr == addr)
+               return -EBUSY;
+       return 0;
+}
+
+static int i2c_check_addr_busy(struct i2c_adapter *adapter, int addr)
+{
+       return device_for_each_child(&adapter->dev, &addr,
+                                    __i2c_check_addr_busy);
+}
+
 /**
  * i2c_new_device - instantiate an i2c device
  * @adap: the adapter managing the device
@@ -410,8 +462,16 @@ i2c_new_device(struct i2c_adapter *adap, struct i2c_board_info const *info)
 
        strlcpy(client->name, info->type, sizeof(client->name));
 
+       /* Check for address validity */
+       status = i2c_check_client_addr_validity(client);
+       if (status) {
+               dev_err(&adap->dev, "Invalid %d-bit I2C address 0x%02hx\n",
+                       client->flags & I2C_CLIENT_TEN ? 10 : 7, client->addr);
+               goto out_err_silent;
+       }
+
        /* Check for address business */
-       status = i2c_check_addr(adap, client->addr);
+       status = i2c_check_addr_busy(adap, client->addr);
        if (status)
                goto out_err;
 
@@ -436,6 +496,7 @@ i2c_new_device(struct i2c_adapter *adap, struct i2c_board_info const *info)
 out_err:
        dev_err(&adap->dev, "Failed to register i2c client %s at 0x%02x "
                "(%d)\n", client->name, client->addr, status);
+out_err_silent:
        kfree(client);
        return NULL;
 }
@@ -561,15 +622,9 @@ i2c_sysfs_new_device(struct device *dev, struct device_attribute *attr,
                return -EINVAL;
        }
 
-       if (info.addr < 0x03 || info.addr > 0x77) {
-               dev_err(dev, "%s: Invalid I2C address 0x%hx\n", "new_device",
-                       info.addr);
-               return -EINVAL;
-       }
-
        client = i2c_new_device(adap, &info);
        if (!client)
-               return -EEXIST;
+               return -EINVAL;
 
        /* Keep track of the added device */
        i2c_lock_adapter(adap);
@@ -1024,21 +1079,6 @@ EXPORT_SYMBOL(i2c_del_driver);
 
 /* ------------------------------------------------------------------------- */
 
-static int __i2c_check_addr(struct device *dev, void *addrp)
-{
-       struct i2c_client       *client = i2c_verify_client(dev);
-       int                     addr = *(int *)addrp;
-
-       if (client && client->addr == addr)
-               return -EBUSY;
-       return 0;
-}
-
-static int i2c_check_addr(struct i2c_adapter *adapter, int addr)
-{
-       return device_for_each_child(&adapter->dev, &addr, __i2c_check_addr);
-}
-
 /**
  * i2c_use_client - increments the reference count of the i2c client structure
  * @client: the client being referenced
@@ -1277,6 +1317,41 @@ EXPORT_SYMBOL(i2c_master_recv);
  * ----------------------------------------------------
  */
 
+/*
+ * Legacy default probe function, mostly relevant for SMBus. The default
+ * probe method is a quick write, but it is known to corrupt the 24RF08
+ * EEPROMs due to a state machine bug, and could also irreversibly
+ * write-protect some EEPROMs, so for address ranges 0x30-0x37 and 0x50-0x5f,
+ * we use a short byte read instead. Also, some bus drivers don't implement
+ * quick write, so we fallback to a byte read in that case too.
+ * On x86, there is another special case for FSC hardware monitoring chips,
+ * which want regular byte reads (address 0x73.) Fortunately, these are the
+ * only known chips using this I2C address on PC hardware.
+ * Returns 1 if probe succeeded, 0 if not.
+ */
+static int i2c_default_probe(struct i2c_adapter *adap, unsigned short addr)
+{
+       int err;
+       union i2c_smbus_data dummy;
+
+#ifdef CONFIG_X86
+       if (addr == 0x73 && (adap->class & I2C_CLASS_HWMON)
+        && i2c_check_functionality(adap, I2C_FUNC_SMBUS_READ_BYTE_DATA))
+               err = i2c_smbus_xfer(adap, addr, 0, I2C_SMBUS_READ, 0,
+                                    I2C_SMBUS_BYTE_DATA, &dummy);
+       else
+#endif
+       if ((addr & ~0x07) == 0x30 || (addr & ~0x0f) == 0x50
+        || !i2c_check_functionality(adap, I2C_FUNC_SMBUS_QUICK))
+               err = i2c_smbus_xfer(adap, addr, 0, I2C_SMBUS_READ, 0,
+                                    I2C_SMBUS_BYTE, &dummy);
+       else
+               err = i2c_smbus_xfer(adap, addr, 0, I2C_SMBUS_WRITE, 0,
+                                    I2C_SMBUS_QUICK, NULL);
+
+       return err >= 0;
+}
+
 static int i2c_detect_address(struct i2c_client *temp_client,
                              struct i2c_driver *driver)
 {
@@ -1286,34 +1361,20 @@ static int i2c_detect_address(struct i2c_client *temp_client,
        int err;
 
        /* Make sure the address is valid */
-       if (addr < 0x03 || addr > 0x77) {
+       err = i2c_check_addr_validity(addr);
+       if (err) {
                dev_warn(&adapter->dev, "Invalid probe address 0x%02x\n",
                         addr);
-               return -EINVAL;
+               return err;
        }
 
        /* Skip if already in use */
-       if (i2c_check_addr(adapter, addr))
+       if (i2c_check_addr_busy(adapter, addr))
                return 0;
 
        /* Make sure there is something at this address */
-       if (addr == 0x73 && (adapter->class & I2C_CLASS_HWMON)) {
-               /* Special probe for FSC hwmon chips */
-               union i2c_smbus_data dummy;
-
-               if (i2c_smbus_xfer(adapter, addr, 0, I2C_SMBUS_READ, 0,
-                                  I2C_SMBUS_BYTE_DATA, &dummy) < 0)
-                       return 0;
-       } else {
-               if (i2c_smbus_xfer(adapter, addr, 0, I2C_SMBUS_WRITE, 0,
-                                  I2C_SMBUS_QUICK, NULL) < 0)
-                       return 0;
-
-               /* Prevent 24RF08 corruption */
-               if ((addr & ~0x0f) == 0x50)
-                       i2c_smbus_xfer(adapter, addr, 0, I2C_SMBUS_WRITE, 0,
-                                      I2C_SMBUS_QUICK, NULL);
-       }
+       if (!i2c_default_probe(adapter, addr))
+               return 0;
 
        /* Finally call the custom detection function */
        memset(&info, 0, sizeof(struct i2c_board_info));
@@ -1407,42 +1468,22 @@ i2c_new_probed_device(struct i2c_adapter *adap,
 
        for (i = 0; addr_list[i] != I2C_CLIENT_END; i++) {
                /* Check address validity */
-               if (addr_list[i] < 0x03 || addr_list[i] > 0x77) {
+               if (i2c_check_addr_validity(addr_list[i]) < 0) {
                        dev_warn(&adap->dev, "Invalid 7-bit address "
                                 "0x%02x\n", addr_list[i]);
                        continue;
                }
 
                /* Check address availability */
-               if (i2c_check_addr(adap, addr_list[i])) {
+               if (i2c_check_addr_busy(adap, addr_list[i])) {
                        dev_dbg(&adap->dev, "Address 0x%02x already in "
                                "use, not probing\n", addr_list[i]);
                        continue;
                }
 
-               /* Test address responsiveness
-                  The default probe method is a quick write, but it is known
-                  to corrupt the 24RF08 EEPROMs due to a state machine bug,
-                  and could also irreversibly write-protect some EEPROMs, so
-                  for address ranges 0x30-0x37 and 0x50-0x5f, we use a byte
-                  read instead. Also, some bus drivers don't implement
-                  quick write, so we fallback to a byte read it that case
-                  too. */
-               if ((addr_list[i] & ~0x07) == 0x30
-                || (addr_list[i] & ~0x0f) == 0x50
-                || !i2c_check_functionality(adap, I2C_FUNC_SMBUS_QUICK)) {
-                       union i2c_smbus_data data;
-
-                       if (i2c_smbus_xfer(adap, addr_list[i], 0,
-                                          I2C_SMBUS_READ, 0,
-                                          I2C_SMBUS_BYTE, &data) >= 0)
-                               break;
-               } else {
-                       if (i2c_smbus_xfer(adap, addr_list[i], 0,
-                                          I2C_SMBUS_WRITE, 0,
-                                          I2C_SMBUS_QUICK, NULL) >= 0)
-                               break;
-               }
+               /* Test address responsiveness */
+               if (i2c_default_probe(adap, addr_list[i]))
+                       break;
        }
 
        if (addr_list[i] == I2C_CLIENT_END) {
index a24e0bfe9201a87a7012b1f42791d925aaf5b76f..f61ccc1e5ea3ea7a350af1cc3ec7858bf0f5dbe8 100644 (file)
@@ -173,7 +173,6 @@ static int smbalert_remove(struct i2c_client *ara)
 
        cancel_work_sync(&alert->alert);
 
-       i2c_set_clientdata(ara, NULL);
        kfree(alert);
        return 0;
 }
index 4771ab172b59b22dda93eaa5437aba8019d7a208..744600eff222935b8af076ac8122c07f22a896e9 100644 (file)
@@ -287,7 +287,6 @@ static int __devexit adp5588_remove(struct i2c_client *client)
        free_irq(client->irq, kpad);
        cancel_delayed_work_sync(&kpad->work);
        input_unregister_device(kpad->input);
-       i2c_set_clientdata(client, NULL);
        kfree(kpad);
 
        return 0;
index bc696931fed7b127a87afb262f63aa26fc63ac9a..40b032f0e32cd47a12e33f300810da9a131941c0 100644 (file)
@@ -778,8 +778,6 @@ static int __devexit lm8323_remove(struct i2c_client *client)
        struct lm8323_chip *lm = i2c_get_clientdata(client);
        int i;
 
-       i2c_set_clientdata(client, NULL);
-
        disable_irq_wake(client->irq);
        free_irq(client->irq, lm);
        cancel_work_sync(&lm->work);
index 7fc8185e5c1bd8ab914cedb0f0d78e15e974ed89..9091ff5ea808b8829d7d9475f15f704532d10c5e 100644 (file)
@@ -265,7 +265,6 @@ static int __devexit max7359_remove(struct i2c_client *client)
 
        free_irq(client->irq, keypad);
        input_unregister_device(keypad->input_dev);
-       i2c_set_clientdata(client, NULL);
        kfree(keypad);
 
        return 0;
index 31f30087b591866c9e81af4401d0a3feeaae359e..fac695157e8afce221fb8dae22fa2d750d745963 100644 (file)
@@ -358,7 +358,6 @@ static int __devexit qt2160_remove(struct i2c_client *client)
        input_unregister_device(qt2160->input);
        kfree(qt2160);
 
-       i2c_set_clientdata(client, NULL);
        return 0;
 }
 
index 493c93f25e2abb96c0555d46d6ac9f20801d9098..00137bebcf974a8133ff3f4f4234bcace30cd084 100644 (file)
@@ -316,8 +316,6 @@ static int __devexit tca6416_keypad_remove(struct i2c_client *client)
        input_unregister_device(chip->input);
        kfree(chip);
 
-       i2c_set_clientdata(client, NULL);
-
        return 0;
 }
 
index e9adbe49f6a49fe0a01e74648747985cb517061d..2bef8fa56c948e0ba4305ea0f4f22450244f79d4 100644 (file)
@@ -97,7 +97,6 @@ static int __devexit ad714x_i2c_remove(struct i2c_client *client)
        struct ad714x_chip *chip = i2c_get_clientdata(client);
 
        ad714x_remove(chip);
-       i2c_set_clientdata(client, NULL);
 
        return 0;
 }
index 5c3ac4e0b055837976624cbd3ef1873cc81d82c6..0ac47d2898ec6d2baca97153f737f75878ffa950 100644 (file)
@@ -168,8 +168,6 @@ static int __devexit pcf8574_kp_remove(struct i2c_client *client)
        input_unregister_device(lp->idev);
        kfree(lp);
 
-       i2c_set_clientdata(client, NULL);
-
        return 0;
 }
 
index 8291e7399ffab3606d2563a8e7257e513b5179f6..0ae62f0bcb3216ca32c494e3a807a75a8f6753bd 100644 (file)
@@ -613,7 +613,6 @@ static int __devexit synaptics_i2c_remove(struct i2c_client *client)
                free_irq(client->irq, touch);
 
        input_unregister_device(touch->input);
-       i2c_set_clientdata(client, NULL);
        kfree(touch);
 
        return 0;
index 794d070c6900607752f2af1b7641f0cc98ef267f..4b32fb4704cd37b24f67c84db53de4ed431320c8 100644 (file)
@@ -812,10 +812,8 @@ static int __devinit ad7879_probe(struct i2c_client *client,
        ts->bus = client;
 
        error = ad7879_construct(client, ts);
-       if (error) {
-               i2c_set_clientdata(client, NULL);
+       if (error)
                kfree(ts);
-       }
 
        return error;
 }
@@ -825,7 +823,6 @@ static int __devexit ad7879_remove(struct i2c_client *client)
        struct ad7879 *ts = dev_get_drvdata(&client->dev);
 
        ad7879_destroy(client, ts);
-       i2c_set_clientdata(client, NULL);
        kfree(ts);
 
        return 0;
index 75f8b73010fa5aa30dd3758a7421697b16c03e46..7a3a916f84a857137332ba89a53373d9dfe136d7 100644 (file)
@@ -238,7 +238,6 @@ err2:
        input = NULL; /* so we dont try to free it below */
 err1:
        input_free_device(input);
-       i2c_set_clientdata(client, NULL);
        kfree(priv);
 err0:
        return err;
@@ -256,7 +255,6 @@ static int __devexit eeti_ts_remove(struct i2c_client *client)
        enable_irq(priv->irq);
 
        input_unregister_device(priv->input);
-       i2c_set_clientdata(client, NULL);
        kfree(priv);
 
        return 0;
index ce8ab0269f6fc755f6496e90a5a4cd4c8157b816..1fb0c2f06a4470657b1b05e5295b77b3c67d6236 100644 (file)
@@ -256,7 +256,6 @@ static int __devexit mcs5000_ts_remove(struct i2c_client *client)
        free_irq(client->irq, data);
        input_unregister_device(data->input_dev);
        kfree(data);
-       i2c_set_clientdata(client, NULL);
 
        return 0;
 }
index 769b479fcaa625fb4406096dd84746b89cc877e4..be23780e8a3e3b81be9df7b7cd0f8aab86d87e61 100644 (file)
@@ -347,8 +347,6 @@ static int __devexit tsc2007_remove(struct i2c_client *client)
        struct tsc2007  *ts = i2c_get_clientdata(client);
        struct tsc2007_platform_data *pdata = client->dev.platform_data;
 
-       i2c_set_clientdata(client, NULL);
-
        tsc2007_free_irq(ts);
 
        if (pdata->exit_platform_hw)
index 286b501a3573d3b7d0d4cec872fa7b40008c83d5..5dcdf9d69b3abae8d0370ccbe1a0d913c716e7d1 100644 (file)
@@ -742,7 +742,6 @@ failed_unregister_dev_file:
        for (i--; i >= 0; i--)
                device_remove_file(&led->client->dev, bd2802_attributes[i]);
 failed_free:
-       i2c_set_clientdata(client, NULL);
        kfree(led);
 
        return ret;
@@ -759,7 +758,6 @@ static int __exit bd2802_remove(struct i2c_client *client)
                bd2802_disable_adv_conf(led);
        for (i = 0; i < ARRAY_SIZE(bd2802_attributes); i++)
                device_remove_file(&led->client->dev, bd2802_attributes[i]);
-       i2c_set_clientdata(client, NULL);
        kfree(led);
 
        return 0;
index 932a58da76c4e97cba12a3c7b657b72dafa70e86..9010c054615e414fa5c236a8fe2cc4a700a00757 100644 (file)
@@ -432,7 +432,6 @@ static int __devexit lp3944_remove(struct i2c_client *client)
                }
 
        kfree(data);
-       i2c_set_clientdata(client, NULL);
 
        return 0;
 }
index 6682175fa9f7c4e3c5a91d99120c83b2003f6b9a..43d08756d823556b26f5c531d6837ff89818964b 100644 (file)
@@ -320,10 +320,8 @@ static int pca9532_probe(struct i2c_client *client,
        mutex_init(&data->update_lock);
 
        err = pca9532_configure(client, data, pca9532_pdata);
-       if (err) {
+       if (err)
                kfree(data);
-               i2c_set_clientdata(client, NULL);
-       }
 
        return err;
 }
@@ -351,7 +349,6 @@ static int pca9532_remove(struct i2c_client *client)
                }
 
        kfree(data);
-       i2c_set_clientdata(client, NULL);
        return 0;
 }
 
index 8ff50f234190a38129342d743a14c8c7c201ad6c..66aa3e8e786f545c4db0e6bd4318a173a792fc1e 100644 (file)
@@ -342,7 +342,6 @@ exit:
        }
 
        kfree(pca955x);
-       i2c_set_clientdata(client, NULL);
 
        return err;
 }
@@ -358,7 +357,6 @@ static int __devexit pca955x_remove(struct i2c_client *client)
        }
 
        kfree(pca955x);
-       i2c_set_clientdata(client, NULL);
 
        return 0;
 }
index 16d82f17ae82b3a2e0f5a5e37a0a73e18e51e7b5..c42eeb43042daa92d9f04e22b2205ce6d1d2a33d 100644 (file)
@@ -182,7 +182,6 @@ remove_thermostat(struct i2c_client *client)
 
        thermostat = NULL;
 
-       i2c_set_clientdata(client, NULL);
        kfree(th);
 
        return 0;
@@ -400,7 +399,6 @@ static int probe_thermostat(struct i2c_client *client,
        rc = read_reg(th, CONFIG_REG);
        if (rc < 0) {
                dev_err(&client->dev, "Thermostat failed to read config!\n");
-               i2c_set_clientdata(client, NULL);
                kfree(th);
                return -ENODEV;
        }
index d8257d35afde91c225b49bad6f0cc9885cf3fc69..647c6add2193e63d9bcec2be088ac2f28096a962 100644 (file)
@@ -107,10 +107,8 @@ static int wf_lm75_probe(struct i2c_client *client,
        i2c_set_clientdata(client, lm);
 
        rc = wf_register_sensor(&lm->sens);
-       if (rc) {
-               i2c_set_clientdata(client, NULL);
+       if (rc)
                kfree(lm);
-       }
 
        return rc;
 }
@@ -216,7 +214,6 @@ static int wf_lm75_remove(struct i2c_client *client)
        /* release sensor */
        wf_unregister_sensor(&lm->sens);
 
-       i2c_set_clientdata(client, NULL);
        return 0;
 }
 
index b486eb929fde725fb9e0271d4af46cdc241c2113..8204113268f471db6021ffa7915be03272a0c40c 100644 (file)
@@ -81,7 +81,6 @@ static int wf_max6690_probe(struct i2c_client *client,
 
        rc = wf_register_sensor(&max->sens);
        if (rc) {
-               i2c_set_clientdata(client, NULL);
                kfree(max);
        }
 
index e20330a28959bc539d0691337bf49438e2022efe..65a8ff3e1f8e8d4e1e73a7a7eda4bb9500fb9c82 100644 (file)
@@ -376,7 +376,6 @@ static int wf_sat_remove(struct i2c_client *client)
        /* XXX TODO */
 
        sat->i2c = NULL;
-       i2c_set_clientdata(client, NULL);
        return 0;
 }
 
index a5844d08d8b7917c19702d9f7879a1bc0244aba4..67a4ec8768a6145ecfd6fb1d44095bfb51f29fdc 100644 (file)
@@ -482,7 +482,6 @@ static __devexit int si470x_i2c_remove(struct i2c_client *client)
        cancel_work_sync(&radio->radio_work);
        video_unregister_device(radio->videodev);
        kfree(radio);
-       i2c_set_clientdata(client, NULL);
 
        return 0;
 }
index b62c0bd3f8ea013de803ceac7f3f25f1c7a9bb57..e3b9a8ab37f4e5c53f11c14d82a8855883f50036 100644 (file)
@@ -785,7 +785,6 @@ static int mt9m001_probe(struct i2c_client *client,
        ret = mt9m001_video_probe(icd, client);
        if (ret) {
                icd->ops = NULL;
-               i2c_set_clientdata(client, NULL);
                kfree(mt9m001);
        }
 
@@ -799,7 +798,6 @@ static int mt9m001_remove(struct i2c_client *client)
 
        icd->ops = NULL;
        mt9m001_video_remove(icd);
-       i2c_set_clientdata(client, NULL);
        client->driver = NULL;
        kfree(mt9m001);
 
index d35f536f9fc37fd6729211d9610adbfa2334c77e..e42162c50f0a3436ae74ee2249221b6ff75a1120 100644 (file)
@@ -1068,7 +1068,6 @@ static int mt9m111_probe(struct i2c_client *client,
        ret = mt9m111_video_probe(icd, client);
        if (ret) {
                icd->ops = NULL;
-               i2c_set_clientdata(client, NULL);
                kfree(mt9m111);
        }
 
@@ -1081,7 +1080,6 @@ static int mt9m111_remove(struct i2c_client *client)
        struct soc_camera_device *icd = client->dev.platform_data;
 
        icd->ops = NULL;
-       i2c_set_clientdata(client, NULL);
        client->driver = NULL;
        kfree(mt9m111);
 
index 78b4e091d2d5f527dd76db13a072bb339289fa84..9f5ff2547f1993bde3f594aa95bf4bb11d23c50d 100644 (file)
@@ -883,7 +883,6 @@ static int mt9t031_probe(struct i2c_client *client,
        if (ret) {
                if (icd)
                        icd->ops = NULL;
-               i2c_set_clientdata(client, NULL);
                kfree(mt9t031);
        }
 
@@ -897,7 +896,6 @@ static int mt9t031_remove(struct i2c_client *client)
 
        if (icd)
                icd->ops = NULL;
-       i2c_set_clientdata(client, NULL);
        client->driver = NULL;
        kfree(mt9t031);
 
index 7438f8d775ba7fa09fb32f9ad2f0a8934606afb5..aa4fce95098f06a5e8dcb832cd56d7d15de972ba 100644 (file)
@@ -1119,7 +1119,6 @@ static int mt9t112_probe(struct i2c_client *client,
        ret = mt9t112_camera_probe(icd, client);
        if (ret) {
                icd->ops = NULL;
-               i2c_set_clientdata(client, NULL);
                kfree(priv);
        }
 
@@ -1132,7 +1131,6 @@ static int mt9t112_remove(struct i2c_client *client)
        struct soc_camera_device *icd = client->dev.platform_data;
 
        icd->ops = NULL;
-       i2c_set_clientdata(client, NULL);
        kfree(priv);
        return 0;
 }
index e5bae4c9393b8b9e3d4a0c8acbcf770d627fe3bc..fb44ff006628834fb45b5d728589edfad34b99a8 100644 (file)
@@ -920,7 +920,6 @@ static int mt9v022_probe(struct i2c_client *client,
        ret = mt9v022_video_probe(icd, client);
        if (ret) {
                icd->ops = NULL;
-               i2c_set_clientdata(client, NULL);
                kfree(mt9v022);
        }
 
@@ -934,7 +933,6 @@ static int mt9v022_remove(struct i2c_client *client)
 
        icd->ops = NULL;
        mt9v022_video_remove(icd);
-       i2c_set_clientdata(client, NULL);
        client->driver = NULL;
        kfree(mt9v022);
 
index 7f8ece30c77ba790cb38c314783544a0de0e162d..c33acc94b7472c5c6fdaec46b26d1690fed541d7 100644 (file)
@@ -1159,7 +1159,6 @@ static int ov772x_probe(struct i2c_client *client,
        ret = ov772x_video_probe(icd, client);
        if (ret) {
                icd->ops = NULL;
-               i2c_set_clientdata(client, NULL);
                kfree(priv);
        }
 
@@ -1172,7 +1171,6 @@ static int ov772x_remove(struct i2c_client *client)
        struct soc_camera_device *icd = client->dev.platform_data;
 
        icd->ops = NULL;
-       i2c_set_clientdata(client, NULL);
        kfree(priv);
        return 0;
 }
index 36599a65f54851759f47a5a412bd5fdc629b8e1f..035e9ecb0c7569ce0e65bde6607d1b6b529c10ff 100644 (file)
@@ -783,7 +783,6 @@ static int ov9640_probe(struct i2c_client *client,
 
        if (ret) {
                icd->ops = NULL;
-               i2c_set_clientdata(client, NULL);
                kfree(priv);
        }
 
@@ -794,7 +793,6 @@ static int ov9640_remove(struct i2c_client *client)
 {
        struct ov9640_priv *priv = i2c_get_clientdata(client);
 
-       i2c_set_clientdata(client, NULL);
        kfree(priv);
        return 0;
 }
index bbd9c11e2c5a721436230f6656f83806058ade54..2c3b58c99e1884fb8db7bc7546eb758b5aaea094 100644 (file)
@@ -1444,7 +1444,6 @@ static int rj54n1_probe(struct i2c_client *client,
        ret = rj54n1_video_probe(icd, client, rj54n1_priv);
        if (ret < 0) {
                icd->ops = NULL;
-               i2c_set_clientdata(client, NULL);
                kfree(rj54n1);
                return ret;
        }
@@ -1461,7 +1460,6 @@ static int rj54n1_remove(struct i2c_client *client)
        icd->ops = NULL;
        if (icl->free_bus)
                icl->free_bus(icl);
-       i2c_set_clientdata(client, NULL);
        client->driver = NULL;
        kfree(rj54n1);
 
index b90e9da3167dde4e38df0037832375e9aaa48e3f..54681a5358222df6a722451e92d9fd9e627d22f8 100644 (file)
@@ -850,7 +850,6 @@ static int tcm825x_probe(struct i2c_client *client,
                         const struct i2c_device_id *did)
 {
        struct tcm825x_sensor *sensor = &tcm825x;
-       int rval;
 
        if (i2c_get_clientdata(client))
                return -EBUSY;
@@ -871,11 +870,7 @@ static int tcm825x_probe(struct i2c_client *client,
        sensor->pix.height = tcm825x_sizes[QVGA].height;
        sensor->pix.pixelformat = V4L2_PIX_FMT_RGB565;
 
-       rval = v4l2_int_device_register(sensor->v4l2_int_device);
-       if (rval)
-               i2c_set_clientdata(client, NULL);
-
-       return rval;
+       return v4l2_int_device_register(sensor->v4l2_int_device);
 }
 
 static int tcm825x_remove(struct i2c_client *client)
@@ -886,7 +881,6 @@ static int tcm825x_remove(struct i2c_client *client)
                return -ENODEV; /* our client isn't attached */
 
        v4l2_int_device_unregister(sensor->v4l2_int_device);
-       i2c_set_clientdata(client, NULL);
 
        return 0;
 }
index 76be733eabfd4d3f7b4bc474219a6f0a9c8fb5ea..6eb3395def077754f30e7be7cdb5c1a60ea57b4c 100644 (file)
@@ -977,7 +977,6 @@ static int tw9910_probe(struct i2c_client *client,
        ret = tw9910_video_probe(icd, client);
        if (ret) {
                icd->ops = NULL;
-               i2c_set_clientdata(client, NULL);
                kfree(priv);
        }
 
@@ -990,7 +989,6 @@ static int tw9910_remove(struct i2c_client *client)
        struct soc_camera_device *icd = client->dev.platform_data;
 
        icd->ops = NULL;
-       i2c_set_clientdata(client, NULL);
        kfree(priv);
        return 0;
 }
index c933b64d1283645071301eb4571b45e7ede1909a..bc02e6b21608be1ee4a0fcf4e52e3e6e7f383982 100644 (file)
@@ -200,8 +200,6 @@ static int __devexit pm860x_remove(struct i2c_client *client)
 
        pm860x_device_exit(chip);
        i2c_unregister_device(chip->companion);
-       i2c_set_clientdata(chip->client, NULL);
-       i2c_set_clientdata(client, NULL);
        kfree(chip);
        return 0;
 }
index 53ebfee548fa3bfbc5311d34c98bfc5b166290b7..66379b413906a3ed5147370040ed7ccffd0b5068 100644 (file)
@@ -957,7 +957,6 @@ static int __init ab3100_probe(struct i2c_client *client,
        i2c_unregister_device(ab3100->testreg_client);
  exit_no_testreg_client:
  exit_no_detect:
-       i2c_set_clientdata(client, NULL);
        kfree(ab3100);
        return err;
 }
@@ -979,7 +978,6 @@ static int __exit ab3100_remove(struct i2c_client *client)
         * their notifiers so deactivate IRQ
         */
        free_irq(client->irq, ab3100);
-       i2c_set_clientdata(client, NULL);
        kfree(ab3100);
        return 0;
 }
index 1060f8e1c40a1cd0c280b2dbfcb3759fd932241e..f54ab62e7bc6b50a11558b470637889d8a5c6533 100644 (file)
@@ -1362,7 +1362,6 @@ static int __exit ab3550_remove(struct i2c_client *client)
         * their notifiers so deactivate IRQ
         */
        free_irq(client->irq, ab);
-       i2c_set_clientdata(client, NULL);
        kfree(ab);
        return 0;
 }
index 005532865654b0bbfa036bc873a37858220ffac1..3122139b430022d819b532ba90d4d7dbccf69c96 100644 (file)
@@ -302,7 +302,6 @@ out_free_irq:
                free_irq(chip->irq, chip);
 
 out_free_chip:
-       i2c_set_clientdata(client, NULL);
        kfree(chip);
 
        return ret;
@@ -317,7 +316,6 @@ static int __devexit adp5520_remove(struct i2c_client *client)
 
        adp5520_remove_subdevs(chip);
        adp5520_write(chip->dev, ADP5520_MODE_STATUS, 0);
-       i2c_set_clientdata(client, NULL);
        kfree(chip);
        return 0;
 }
index 3ad915d0589c0626234ffdbc357afbbe2ff37af3..c07aece900fbb93b9ec08b2aa99ee85e144093fe 100644 (file)
@@ -534,7 +534,6 @@ static int __devinit da903x_probe(struct i2c_client *client,
 out_free_irq:
        free_irq(client->irq, chip);
 out_free_chip:
-       i2c_set_clientdata(client, NULL);
        kfree(chip);
        return ret;
 }
@@ -544,7 +543,6 @@ static int __devexit da903x_remove(struct i2c_client *client)
        struct da903x_chip *chip = i2c_get_clientdata(client);
 
        da903x_remove_subdevs(chip);
-       i2c_set_clientdata(client, NULL);
        kfree(chip);
        return 0;
 }
index e73f3f5252a89cf138dac35254263ed58630f72c..0219115e00c73f84c925045afceb96d65ea83ea3 100644 (file)
@@ -173,7 +173,6 @@ static int __devexit max8925_remove(struct i2c_client *client)
        max8925_device_exit(chip);
        i2c_unregister_device(chip->adc);
        i2c_unregister_device(chip->rtc);
-       i2c_set_clientdata(chip->i2c, NULL);
        kfree(chip);
        return 0;
 }
index 721948be12c77a7ad622e3559abc2f3953c1365a..a3fb4bcb98897718400da09d23dfd95116b99f58 100644 (file)
@@ -1228,7 +1228,6 @@ fail2:
        free_irq(client->irq, menelaus);
        flush_scheduled_work();
 fail1:
-       i2c_set_clientdata(client, NULL);
        kfree(menelaus);
        return err;
 }
@@ -1238,7 +1237,6 @@ static int __exit menelaus_remove(struct i2c_client *client)
        struct menelaus_chip    *menelaus = i2c_get_clientdata(client);
 
        free_irq(client->irq, menelaus);
-       i2c_set_clientdata(client, NULL);
        kfree(menelaus);
        the_menelaus = NULL;
        return 0;
index 704736e6e9b9b2efea2c66f4cf3a6ee36183eaa4..23e58552728596d7be431583e27602792b7e65d3 100644 (file)
@@ -336,7 +336,6 @@ static int __devinit pcf50633_probe(struct i2c_client *client,
        return 0;
 
 err_free:
-       i2c_set_clientdata(client, NULL);
        kfree(pcf);
 
        return ret;
@@ -357,7 +356,6 @@ static int __devexit pcf50633_remove(struct i2c_client *client)
        for (i = 0; i < PCF50633_NUM_REGULATORS; i++)
                platform_device_unregister(pcf->regulator_pdev[i]);
 
-       i2c_set_clientdata(client, NULL);
        kfree(pcf);
 
        return 0;
index 715f095dd7a6119b580e6eed2a6b425347ed88d4..e619e2a55997ebd0ed1ab6f27969da4497a78de9 100644 (file)
@@ -296,7 +296,6 @@ out_freeirq:
 out_removeirq:
        tc35892_irq_remove(tc35892);
 out_free:
-       i2c_set_clientdata(i2c, NULL);
        kfree(tc35892);
        return ret;
 }
@@ -310,7 +309,6 @@ static int __devexit tc35892_remove(struct i2c_client *client)
        free_irq(tc35892->i2c->irq, tc35892);
        tc35892_irq_remove(tc35892);
 
-       i2c_set_clientdata(client, NULL);
        kfree(tc35892);
 
        return 0;
index 9b22a77f70f5dac90aec0395d176d9ad06d4a71f..d0016b67d125ce40b8d9a810f1abb7ade2678756 100644 (file)
@@ -530,7 +530,6 @@ static int __exit tps65010_remove(struct i2c_client *client)
        cancel_delayed_work(&tps->work);
        flush_scheduled_work();
        debugfs_remove(tps->file);
-       i2c_set_clientdata(client, NULL);
        kfree(tps);
        the_tps = NULL;
        return 0;
index 7795af4b1fe15f7ee4690bd1a16eb17188ac492f..5fe5de166adb39bdafb2e7714ce046f58b6ccb3b 100644 (file)
@@ -80,7 +80,6 @@ static int wm8350_i2c_probe(struct i2c_client *i2c,
        return ret;
 
 err:
-       i2c_set_clientdata(i2c, NULL);
        kfree(wm8350);
        return ret;
 }
@@ -90,7 +89,6 @@ static int wm8350_i2c_remove(struct i2c_client *i2c)
        struct wm8350 *wm8350 = i2c_get_clientdata(i2c);
 
        wm8350_device_exit(wm8350);
-       i2c_set_clientdata(i2c, NULL);
        kfree(wm8350);
 
        return 0;
index e08aafa663dc4a1460bd901fd369fe9ec11a12b9..1bfef4846b07b0d98138c87509872937b2c29e6f 100644 (file)
@@ -415,7 +415,6 @@ static int wm8400_i2c_probe(struct i2c_client *i2c,
        return 0;
 
 struct_err:
-       i2c_set_clientdata(i2c, NULL);
        kfree(wm8400);
 err:
        return ret;
@@ -426,7 +425,6 @@ static int wm8400_i2c_remove(struct i2c_client *i2c)
        struct wm8400 *wm8400 = i2c_get_clientdata(i2c);
 
        wm8400_release(wm8400);
-       i2c_set_clientdata(i2c, NULL);
        kfree(wm8400);
 
        return 0;
index f7ca3a42b49089fcf48c6927260057d908641762..559b0b3c16c379584be01a08db209e2437549a04 100644 (file)
@@ -643,7 +643,6 @@ static int __devexit at24_remove(struct i2c_client *client)
 
        kfree(at24->writebuf);
        kfree(at24);
-       i2c_set_clientdata(client, NULL);
        return 0;
 }
 
index eb476b7f8d113cdadd87f558994a1fe95061cf49..f4ce273e93fd5e5888adbc73c9e684bd5568849c 100644 (file)
@@ -234,7 +234,6 @@ static int __devexit pismo_remove(struct i2c_client *client)
        /* FIXME: set_vpp needs saner arguments */
        pismo_setvpp_remove_fix(pismo);
 
-       i2c_set_clientdata(client, NULL);
        kfree(pismo);
 
        return 0;
@@ -286,7 +285,6 @@ static int __devinit pismo_probe(struct i2c_client *client,
        return 0;
 
  exit_free:
-       i2c_set_clientdata(client, NULL);
        kfree(pismo);
        return ret;
 }
index f3e22c9fe20a538581a70fc0d0134bf78a5a1b33..2f2f9a6f54fad6d75dc692fbee4d128b7ba642a4 100644 (file)
@@ -225,7 +225,6 @@ static int __devinit max17040_probe(struct i2c_client *client,
        ret = power_supply_register(&client->dev, &chip->battery);
        if (ret) {
                dev_err(&client->dev, "failed: power supply register\n");
-               i2c_set_clientdata(client, NULL);
                kfree(chip);
                return ret;
        }
@@ -245,7 +244,6 @@ static int __devexit max17040_remove(struct i2c_client *client)
 
        power_supply_unregister(&chip->battery);
        cancel_delayed_work(&chip->work);
-       i2c_set_clientdata(client, NULL);
        kfree(chip);
        return 0;
 }
index 671a7d1f1f0e33e5f9f0fd4e016b742a870da3a4..8ae3732eb24bcd28e414049b583d3644fa8ffd17 100644 (file)
@@ -519,8 +519,6 @@ static int __devexit lp3971_i2c_remove(struct i2c_client *i2c)
        struct lp3971 *lp3971 = i2c_get_clientdata(i2c);
        int i;
 
-       i2c_set_clientdata(i2c, NULL);
-
        for (i = 0; i < lp3971->num_regulators; i++)
                regulator_unregister(lp3971->rdev[i]);
 
index b3c1afc16889434f47c9fd74e387da39bb255737..2b54d9d75f11e2893ead65a3624199fa13fb9b24 100644 (file)
@@ -244,7 +244,6 @@ static int __devexit max1586_pmic_remove(struct i2c_client *client)
        for (i = 0; i <= MAX1586_V6; i++)
                if (rdev[i])
                        regulator_unregister(rdev[i]);
-       i2c_set_clientdata(client, NULL);
        kfree(rdev);
 
        return 0;
index bfc4c5ffdc966f3ab03081259faf52adce239906..4520ace3f7e707f82ccbf0fb068df921dfc6c2df 100644 (file)
@@ -357,7 +357,6 @@ static int __devinit max8649_regulator_probe(struct i2c_client *client,
        dev_info(info->dev, "Max8649 regulator device is detected.\n");
        return 0;
 out:
-       i2c_set_clientdata(client, NULL);
        kfree(info);
        return ret;
 }
@@ -369,7 +368,6 @@ static int __devexit max8649_regulator_remove(struct i2c_client *client)
        if (info) {
                if (info->regulator)
                        regulator_unregister(info->regulator);
-               i2c_set_clientdata(client, NULL);
                kfree(info);
        }
 
index 3790b21879ff2f8d2c5b8000fe216f1f0770a436..d97220efae5ab4f1fde54cd909c724a3f5bf3523 100644 (file)
@@ -471,7 +471,6 @@ static int __devexit max8660_remove(struct i2c_client *client)
        for (i = 0; i < MAX8660_V_END; i++)
                if (rdev[i])
                        regulator_unregister(rdev[i]);
-       i2c_set_clientdata(client, NULL);
        kfree(rdev);
 
        return 0;
index 8e2f2098b00562fd2e9608494569f28f9b85a83f..f50afc9f287a80f04513bcf670839fcf84ebc23b 100644 (file)
@@ -538,9 +538,6 @@ static int __devexit tps_65023_remove(struct i2c_client *client)
        struct tps_pmic *tps = i2c_get_clientdata(client);
        int i;
 
-       /* clear the client data in i2c */
-       i2c_set_clientdata(client, NULL);
-
        for (i = 0; i < TPS65023_NUM_REGULATOR; i++)
                regulator_unregister(tps->rdev[i]);
 
index 61945734ad003c379fde6424c708942b1afbbf8a..1f0007fd44314c5b65ffc39fde6df81cc568d492 100644 (file)
@@ -403,7 +403,6 @@ out_irq:
                free_irq(client->irq, client);
 
 out_free:
-       i2c_set_clientdata(client, NULL);
        kfree(ds1374);
        return ret;
 }
@@ -422,7 +421,6 @@ static int __devexit ds1374_remove(struct i2c_client *client)
        }
 
        rtc_device_unregister(ds1374->rtc);
-       i2c_set_clientdata(client, NULL);
        kfree(ds1374);
        return 0;
 }
index b65c82f792d9cd6f86614304db1f4c9d99077c6b..789f62f9b47d4b288ba8dffe30adeaf123c1fc84 100644 (file)
@@ -632,7 +632,6 @@ errout_reg:
        rtc_device_unregister(rx8025->rtc);
 
 errout_free:
-       i2c_set_clientdata(client, NULL);
        kfree(rx8025);
 
 errout:
@@ -656,7 +655,6 @@ static int __devexit rx8025_remove(struct i2c_client *client)
 
        rx8025_sysfs_unregister(&client->dev);
        rtc_device_unregister(rx8025->rtc);
-       i2c_set_clientdata(client, NULL);
        kfree(rx8025);
        return 0;
 }
index def4d396d0b096cef968a5572f2b5122d92eeb33..f789e002c9b013664a2588ea342b25a52acf8a1c 100644 (file)
@@ -275,7 +275,6 @@ exit_dummy:
                if (s35390a->client[i])
                        i2c_unregister_device(s35390a->client[i]);
        kfree(s35390a);
-       i2c_set_clientdata(client, NULL);
 
 exit:
        return err;
@@ -292,7 +291,6 @@ static int s35390a_remove(struct i2c_client *client)
 
        rtc_device_unregister(s35390a->rtc);
        kfree(s35390a);
-       i2c_set_clientdata(client, NULL);
 
        return 0;
 }
index 1f020dad6234b475ea4edc76dd48d7e02278b341..3320359408a966b15d11809ddf9760b00e2a782a 100644 (file)
@@ -519,7 +519,6 @@ err_input_register_device_failed:
 err_input_dev_alloc_failed:
 err_detect_failed:
 err_power_failed:
-       i2c_set_clientdata(client, NULL);
        kfree(ts);
 err_alloc_data_failed:
 err_check_functionality_failed:
@@ -537,7 +536,6 @@ static int synaptics_ts_remove(struct i2c_client *client)
        else
                hrtimer_cancel(&ts->timer);
        input_unregister_device(ts->input_dev);
-       i2c_set_clientdata(client, NULL);
        kfree(ts);
        return 0;
 }
index bd925457f8b710ec8b44a86b7a32dddc22d0abfd..72f5c1f56d195f9c777ba09106b829f1814b9de0 100644 (file)
@@ -289,7 +289,6 @@ static int wis_saa7113_probe(struct i2c_client *client,
        if (write_regs(client, initial_registers) < 0) {
                printk(KERN_ERR
                        "wis-saa7113: error initializing SAA7113\n");
-               i2c_set_clientdata(client, NULL);
                kfree(dec);
                return -ENODEV;
        }
@@ -301,7 +300,6 @@ static int wis_saa7113_remove(struct i2c_client *client)
 {
        struct wis_saa7113 *dec = i2c_get_clientdata(client);
 
-       i2c_set_clientdata(client, NULL);
        kfree(dec);
        return 0;
 }
index b2eb804c1954ceedd9fe7986e319c9425551babf..cd950b61cf70ee1c4d1d883f2949c5677c085368 100644 (file)
@@ -422,7 +422,6 @@ static int wis_saa7115_probe(struct i2c_client *client,
        if (write_regs(client, initial_registers) < 0) {
                printk(KERN_ERR
                        "wis-saa7115: error initializing SAA7115\n");
-               i2c_set_clientdata(client, NULL);
                kfree(dec);
                return -ENODEV;
        }
@@ -434,7 +433,6 @@ static int wis_saa7115_remove(struct i2c_client *client)
 {
        struct wis_saa7115 *dec = i2c_get_clientdata(client);
 
-       i2c_set_clientdata(client, NULL);
        kfree(dec);
        return 0;
 }
index b1013291190f162f6668af96c8593c81b57cb7e9..981c9b311b8b9643befcd08440b1e598354cc5eb 100644 (file)
@@ -684,7 +684,6 @@ static int wis_sony_tuner_remove(struct i2c_client *client)
 {
        struct wis_sony_tuner *t = i2c_get_clientdata(client);
 
-       i2c_set_clientdata(client, NULL);
        kfree(t);
        return 0;
 }
index 315268d130dd61311873a36bd3ae373ed75f3539..ee28a99dc3883620135726feba6034f54632c9ea 100644 (file)
@@ -323,7 +323,6 @@ static int wis_tw2804_remove(struct i2c_client *client)
 {
        struct wis_tw2804 *dec = i2c_get_clientdata(client);
 
-       i2c_set_clientdata(client, NULL);
        kfree(dec);
        return 0;
 }
index 2afea09091b97e020fff05d4438b1b93156e64a7..80d47269b1c01f4054faeb8f2f4514f242e0dc29 100644 (file)
@@ -294,7 +294,6 @@ static int wis_tw9903_probe(struct i2c_client *client,
 
        if (write_regs(client, initial_registers) < 0) {
                printk(KERN_ERR "wis-tw9903: error initializing TW9903\n");
-               i2c_set_clientdata(client, NULL);
                kfree(dec);
                return -ENODEV;
        }
@@ -306,7 +305,6 @@ static int wis_tw9903_remove(struct i2c_client *client)
 {
        struct wis_tw9903 *dec = i2c_get_clientdata(client);
 
-       i2c_set_clientdata(client, NULL);
        kfree(dec);
        return 0;
 }
index 20e267448d1fdffe25eedf5ef35c1b10c2746413..905f8560d31f94d0a4651d54ab8b8191ca69d1f4 100644 (file)
@@ -1011,7 +1011,6 @@ error_put_reg:
        if (!IS_ERR(st->reg))
                regulator_put(st->reg);
 error_free_st:
-       i2c_set_clientdata(client, NULL);
        kfree(st);
 
 error_ret:
@@ -1030,7 +1029,6 @@ static int max1363_remove(struct i2c_client *client)
                regulator_disable(st->reg);
                regulator_put(st->reg);
        }
-       i2c_set_clientdata(client, NULL);
        kfree(st);
 
        return 0;
index 43aaacff4e744bc6a1d18f182f5ac640ac2eabef..e4b0a5ef1c1f4913d39870c9ef363917ca552e83 100644 (file)
@@ -694,7 +694,6 @@ static int __devinit tsl2563_probe(struct i2c_client *client,
 fail2:
        iio_device_unregister(chip->indio_dev);
 fail1:
-       i2c_set_clientdata(client, NULL);
        kfree(chip);
        return err;
 }
@@ -705,7 +704,6 @@ static int tsl2563_remove(struct i2c_client *client)
 
        iio_device_unregister(chip->indio_dev);
 
-       i2c_set_clientdata(client, NULL);
        kfree(chip);
        return 0;
 }
index 921ca37398f39b63943f3484192140dc355087d6..3ec24609151e8ec322c48afcebae8dc9ce578b5d 100644 (file)
@@ -756,7 +756,6 @@ out:
 out1:
        backlight_device_unregister(bl);
 out2:
-       i2c_set_clientdata(client, NULL);
        kfree(data);
 
        return ret;
@@ -776,7 +775,6 @@ static int __devexit adp8860_remove(struct i2c_client *client)
                        &adp8860_bl_attr_group);
 
        backlight_device_unregister(data->bl);
-       i2c_set_clientdata(client, NULL);
        kfree(data);
 
        return 0;
index e03e60bbfd855f01301ab14d71b1fc9d94453bcc..2a04b382ec4834a03270db15701136f5f01694cf 100644 (file)
@@ -119,7 +119,6 @@ static int __devinit tosa_bl_probe(struct i2c_client *client,
 
 err_reg:
        data->bl = NULL;
-       i2c_set_clientdata(client, NULL);
 err_gpio_dir:
        gpio_free(TOSA_GPIO_BL_C20MA);
 err_gpio_bl:
@@ -133,7 +132,6 @@ static int __devexit tosa_bl_remove(struct i2c_client *client)
 
        backlight_device_unregister(data->bl);
        data->bl = NULL;
-       i2c_set_clientdata(client, NULL);
 
        gpio_free(TOSA_GPIO_BL_C20MA);