diff options
Diffstat (limited to 'drivers/i2c/chips/eeprom.c')
-rw-r--r-- | drivers/i2c/chips/eeprom.c | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/drivers/i2c/chips/eeprom.c b/drivers/i2c/chips/eeprom.c index a2da31b0dd7..d58403a4790 100644 --- a/drivers/i2c/chips/eeprom.c +++ b/drivers/i2c/chips/eeprom.c @@ -33,15 +33,13 @@ #include <linux/sched.h> #include <linux/jiffies.h> #include <linux/i2c.h> -#include <linux/i2c-sensor.h> /* Addresses to scan */ static unsigned short normal_i2c[] = { 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, I2C_CLIENT_END }; -static unsigned int normal_isa[] = { I2C_CLIENT_ISA_END }; /* Insmod parameters */ -SENSORS_INSMOD_1(eeprom); +I2C_CLIENT_INSMOD_1(eeprom); /* Size of EEPROM in bytes */ @@ -153,21 +151,16 @@ static struct bin_attribute eeprom_attr = { static int eeprom_attach_adapter(struct i2c_adapter *adapter) { - return i2c_detect(adapter, &addr_data, eeprom_detect); + return i2c_probe(adapter, &addr_data, eeprom_detect); } -/* This function is called by i2c_detect */ +/* This function is called by i2c_probe */ int eeprom_detect(struct i2c_adapter *adapter, int address, int kind) { struct i2c_client *new_client; struct eeprom_data *data; int err = 0; - /* prevent 24RF08 corruption */ - if (kind < 0) - i2c_smbus_xfer(adapter, address, 0, 0, 0, - I2C_SMBUS_QUICK, NULL); - /* There are three ways we can read the EEPROM data: (1) I2C block reads (faster, but unsupported by most adapters) (2) Consecutive byte reads (100% overhead) @@ -231,10 +224,8 @@ static int eeprom_detach_client(struct i2c_client *client) int err; err = i2c_detach_client(client); - if (err) { - dev_err(&client->dev, "Client deregistration failed, client not detached.\n"); + if (err) return err; - } kfree(i2c_get_clientdata(client)); |