[PATCH] I2C: Centralize 24RF08 corruption prevention
commit4c9337da37c877e53a64696fc8524f642d446cba
authorJean Delvare <khali@linux-fr.org>
Tue, 9 Aug 2005 18:28:10 +0000 (9 20:28 +0200)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 5 Sep 2005 16:14:25 +0000 (5 09:14 -0700)
tree30f34691bd61b55b11ec19f6fbc27ae69886eff8
parenta89ba0bc02e82920a0f4137aa5d655ac0366cc28
[PATCH] I2C: Centralize 24RF08 corruption prevention

The 24RF08 corruption would better be prevented at i2c-core level than
at chip driver level, for several reasons:
* The second quick write should happen as soon as possible after the
  first one, so as to limit the risk that another command is issued on
  the bus inbetween, causing the corruption.
* As a matter of fact, the protection code at driver level was reworked
  at least three times already, which proves how hard it is to get it
  right there, while it's straightforward at i2c-core level.
* It's easy to add a new driver that would need the protection, and
  forget to add it. This did happen already.
* As additional probing addresses can be passed to most i2c chip drivers
  as module parameters, virtually every i2c chip driver would need the
  protection if we want to be really safe.
* Why duplicate code when we can easily avoid it?

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Documentation/i2c/porting-clients
drivers/i2c/chips/eeprom.c
drivers/i2c/chips/max6875.c
drivers/i2c/i2c-core.c