diff options
Diffstat (limited to 'drivers/i2c/chips/pcf8591.c')
-rw-r--r-- | drivers/i2c/chips/pcf8591.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/drivers/i2c/chips/pcf8591.c b/drivers/i2c/chips/pcf8591.c index db812ade8564..80f1df9a4500 100644 --- a/drivers/i2c/chips/pcf8591.c +++ b/drivers/i2c/chips/pcf8591.c | |||
@@ -24,15 +24,13 @@ | |||
24 | #include <linux/init.h> | 24 | #include <linux/init.h> |
25 | #include <linux/slab.h> | 25 | #include <linux/slab.h> |
26 | #include <linux/i2c.h> | 26 | #include <linux/i2c.h> |
27 | #include <linux/i2c-sensor.h> | ||
28 | 27 | ||
29 | /* Addresses to scan */ | 28 | /* Addresses to scan */ |
30 | static unsigned short normal_i2c[] = { 0x48, 0x49, 0x4a, 0x4b, 0x4c, | 29 | static unsigned short normal_i2c[] = { 0x48, 0x49, 0x4a, 0x4b, 0x4c, |
31 | 0x4d, 0x4e, 0x4f, I2C_CLIENT_END }; | 30 | 0x4d, 0x4e, 0x4f, I2C_CLIENT_END }; |
32 | static unsigned int normal_isa[] = { I2C_CLIENT_ISA_END }; | ||
33 | 31 | ||
34 | /* Insmod parameters */ | 32 | /* Insmod parameters */ |
35 | SENSORS_INSMOD_1(pcf8591); | 33 | I2C_CLIENT_INSMOD_1(pcf8591); |
36 | 34 | ||
37 | static int input_mode; | 35 | static int input_mode; |
38 | module_param(input_mode, int, 0); | 36 | module_param(input_mode, int, 0); |
@@ -164,10 +162,10 @@ static DEVICE_ATTR(out0_enable, S_IWUSR | S_IRUGO, | |||
164 | */ | 162 | */ |
165 | static int pcf8591_attach_adapter(struct i2c_adapter *adapter) | 163 | static int pcf8591_attach_adapter(struct i2c_adapter *adapter) |
166 | { | 164 | { |
167 | return i2c_detect(adapter, &addr_data, pcf8591_detect); | 165 | return i2c_probe(adapter, &addr_data, pcf8591_detect); |
168 | } | 166 | } |
169 | 167 | ||
170 | /* This function is called by i2c_detect */ | 168 | /* This function is called by i2c_probe */ |
171 | int pcf8591_detect(struct i2c_adapter *adapter, int address, int kind) | 169 | int pcf8591_detect(struct i2c_adapter *adapter, int address, int kind) |
172 | { | 170 | { |
173 | struct i2c_client *new_client; | 171 | struct i2c_client *new_client; |
@@ -241,11 +239,8 @@ static int pcf8591_detach_client(struct i2c_client *client) | |||
241 | { | 239 | { |
242 | int err; | 240 | int err; |
243 | 241 | ||
244 | if ((err = i2c_detach_client(client))) { | 242 | if ((err = i2c_detach_client(client))) |
245 | dev_err(&client->dev, | ||
246 | "Client deregistration failed, client not detached.\n"); | ||
247 | return err; | 243 | return err; |
248 | } | ||
249 | 244 | ||
250 | kfree(i2c_get_clientdata(client)); | 245 | kfree(i2c_get_clientdata(client)); |
251 | return 0; | 246 | return 0; |