diff options
-rw-r--r-- | drivers/i2c/i2c-core.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c index 96da22e9a5a4..fd84b2a36338 100644 --- a/drivers/i2c/i2c-core.c +++ b/drivers/i2c/i2c-core.c | |||
@@ -90,12 +90,16 @@ static int i2c_device_probe(struct device *dev) | |||
90 | { | 90 | { |
91 | struct i2c_client *client = to_i2c_client(dev); | 91 | struct i2c_client *client = to_i2c_client(dev); |
92 | struct i2c_driver *driver = to_i2c_driver(dev->driver); | 92 | struct i2c_driver *driver = to_i2c_driver(dev->driver); |
93 | int status; | ||
93 | 94 | ||
94 | if (!driver->probe) | 95 | if (!driver->probe) |
95 | return -ENODEV; | 96 | return -ENODEV; |
96 | client->driver = driver; | 97 | client->driver = driver; |
97 | dev_dbg(dev, "probe\n"); | 98 | dev_dbg(dev, "probe\n"); |
98 | return driver->probe(client); | 99 | status = driver->probe(client); |
100 | if (status) | ||
101 | client->driver = NULL; | ||
102 | return status; | ||
99 | } | 103 | } |
100 | 104 | ||
101 | static int i2c_device_remove(struct device *dev) | 105 | static int i2c_device_remove(struct device *dev) |