aboutsummaryrefslogtreecommitdiff
path: root/drivers/i2c/chips/eeprom.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@g5.osdl.org>2005-10-28 14:14:57 -0700
committerLinus Torvalds <torvalds@g5.osdl.org>2005-10-28 14:14:57 -0700
commit20731945ae743034353a88c307920d1f16cf8ac8 (patch)
tree132c796fe3a167dece8cec7a40b1d5dd83a68bc8 /drivers/i2c/chips/eeprom.c
parent406119f49d4a6cf8b6eee639128e0575a95065e3 (diff)
parenta9d1b24d91f91b77db3da8aeacb414764f789b9c (diff)
Merge master.kernel.org:/pub/scm/linux/kernel/git/gregkh/i2c-2.6
Diffstat (limited to 'drivers/i2c/chips/eeprom.c')
-rw-r--r--drivers/i2c/chips/eeprom.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/drivers/i2c/chips/eeprom.c b/drivers/i2c/chips/eeprom.c
index d58403a4790..4baf573fa04 100644
--- a/drivers/i2c/chips/eeprom.c
+++ b/drivers/i2c/chips/eeprom.c
@@ -88,8 +88,8 @@ static void eeprom_update_client(struct i2c_client *client, u8 slice)
dev_dbg(&client->dev, "Starting eeprom update, slice %u\n", slice);
if (i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_READ_I2C_BLOCK)) {
- for (i = slice << 5; i < (slice + 1) << 5; i += I2C_SMBUS_I2C_BLOCK_MAX)
- if (i2c_smbus_read_i2c_block_data(client, i, data->data + i) != I2C_SMBUS_I2C_BLOCK_MAX)
+ for (i = slice << 5; i < (slice + 1) << 5; i += I2C_SMBUS_BLOCK_MAX)
+ if (i2c_smbus_read_i2c_block_data(client, i, data->data + i) != I2C_SMBUS_BLOCK_MAX)
goto exit;
} else {
if (i2c_smbus_write_byte(client, slice << 5)) {
@@ -155,7 +155,7 @@ static int eeprom_attach_adapter(struct i2c_adapter *adapter)
}
/* This function is called by i2c_probe */
-int eeprom_detect(struct i2c_adapter *adapter, int address, int kind)
+static int eeprom_detect(struct i2c_adapter *adapter, int address, int kind)
{
struct i2c_client *new_client;
struct eeprom_data *data;
@@ -171,11 +171,10 @@ int eeprom_detect(struct i2c_adapter *adapter, int address, int kind)
| I2C_FUNC_SMBUS_BYTE))
goto exit;
- if (!(data = kmalloc(sizeof(struct eeprom_data), GFP_KERNEL))) {
+ if (!(data = kzalloc(sizeof(struct eeprom_data), GFP_KERNEL))) {
err = -ENOMEM;
goto exit;
}
- memset(data, 0, sizeof(struct eeprom_data));
new_client = &data->client;
memset(data->data, 0xff, EEPROM_SIZE);