Commit 1f730388 authored by Jean Delvare's avatar Jean Delvare Committed by Greg Kroah-Hartman

[PATCH] I2C: Incomplete AT24RF08 corruption prevention in i2c eeprom

The AT24RF08 corruption prevention trick that is found in the i2c eeprom
driver is not correct. The prevention is activated only conditionally,
while it should be done all the time.
parent 66d20816
...@@ -203,11 +203,12 @@ int eeprom_detect(struct i2c_adapter *adapter, int address, int kind) ...@@ -203,11 +203,12 @@ int eeprom_detect(struct i2c_adapter *adapter, int address, int kind)
new_client->driver = &eeprom_driver; new_client->driver = &eeprom_driver;
new_client->flags = 0; new_client->flags = 0;
/* prevent 24RF08 corruption */
i2c_smbus_write_quick(new_client, 0);
/* Now, we do the remaining detection. It is not there, unless you force /* Now, we do the remaining detection. It is not there, unless you force
the checksum to work out. */ the checksum to work out. */
if (checksum) { if (checksum) {
/* prevent 24RF08 corruption */
i2c_smbus_write_quick(new_client, 0);
cs = 0; cs = 0;
for (i = 0; i <= 0x3e; i++) for (i = 0; i <= 0x3e; i++)
cs += i2c_smbus_read_byte_data(new_client, i); cs += i2c_smbus_read_byte_data(new_client, i);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment