]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - drivers/i2c/i2c-core.c
Merge branch 'i2c/for-current' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa...
[karo-tx-linux.git] / drivers / i2c / i2c-core.c
index 82f7a5354dfea8f31d2a6ddfa69a360d30a235b5..5fb80b8962a2ad7d8e78dcee01df68cb639d3602 100644 (file)
@@ -261,10 +261,9 @@ static int i2c_device_probe(struct device *dev)
 
        acpi_dev_pm_attach(&client->dev, true);
        status = driver->probe(client, i2c_match_id(driver->id_table, client));
-       if (status) {
-               i2c_set_clientdata(client, NULL);
+       if (status)
                acpi_dev_pm_detach(&client->dev, true);
-       }
+
        return status;
 }
 
@@ -272,7 +271,7 @@ static int i2c_device_remove(struct device *dev)
 {
        struct i2c_client       *client = i2c_verify_client(dev);
        struct i2c_driver       *driver;
-       int                     status;
+       int status = 0;
 
        if (!client || !dev->driver)
                return 0;
@@ -281,12 +280,8 @@ static int i2c_device_remove(struct device *dev)
        if (driver->remove) {
                dev_dbg(dev, "remove\n");
                status = driver->remove(client);
-       } else {
-               dev->driver = NULL;
-               status = 0;
        }
-       if (status == 0)
-               i2c_set_clientdata(client, NULL);
+
        acpi_dev_pm_detach(&client->dev, true);
        return status;
 }