]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
env_eeprom - fix bus recovery for "eeprom_bus_read"
authorAlexey Brodkin <Alexey.Brodkin@synopsys.com>
Wed, 11 Dec 2013 14:04:40 +0000 (18:04 +0400)
committerHeiko Schocher <hs@denx.de>
Mon, 13 Jan 2014 07:17:27 +0000 (08:17 +0100)
"env_eeprom_bus" is no longer in use (it was introduced in commit
548738b4d43af841ff58c787bce297ac6a8bf7d1 "cmd_eeprom: I2C updates").

As in "eeprom_bus_write" we just reset I2C bus with the one we saved in
"old_bus".

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
Cc: Wolfgang Denk <wd@denx.de>
Cc: Tom Rini <trini@ti.com>
Cc: Heiko Schocher <hs@denx.de>
common/env_eeprom.c

index 0dcdd1fc80883913719d5ba5beeb93c7c4d62783..0db2bb63fe1d9671b7e586a88e9b4f08063fae37 100644 (file)
@@ -24,7 +24,6 @@ DECLARE_GLOBAL_DATA_PTR;
 env_t *env_ptr;
 
 char *env_name_spec = "EEPROM";
-int env_eeprom_bus = -1;
 
 static int eeprom_bus_read(unsigned dev_addr, unsigned offset,
                           uchar *buffer, unsigned cnt)
@@ -40,8 +39,7 @@ static int eeprom_bus_read(unsigned dev_addr, unsigned offset,
        rcode = eeprom_read(dev_addr, offset, buffer, cnt);
 
 #if defined(CONFIG_I2C_ENV_EEPROM_BUS)
-       if (old_bus != env_eeprom_bus)
-               i2c_set_bus_num(old_bus);
+       i2c_set_bus_num(old_bus);
 #endif
 
        return rcode;
@@ -63,6 +61,7 @@ static int eeprom_bus_write(unsigned dev_addr, unsigned offset,
 #if defined(CONFIG_I2C_ENV_EEPROM_BUS)
        i2c_set_bus_num(old_bus);
 #endif
+
        return rcode;
 }