X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=common%2Fenv_eeprom.c;h=0db2bb63fe1d9671b7e586a88e9b4f08063fae37;hb=337b0c52b3296f371d04aef71a833e09110e0e6b;hp=149370f8348046d2b87a305aa0af503a306c0123;hpb=3be2bdf5dc69b3142c1162a59bc67191c9077567;p=u-boot diff --git a/common/env_eeprom.c b/common/env_eeprom.c index 149370f834..0db2bb63fe 100644 --- a/common/env_eeprom.c +++ b/common/env_eeprom.c @@ -5,7 +5,7 @@ * (C) Copyright 2001 Sysgo Real-Time Solutions, GmbH * Andreas Heppel * - * SPDX-License-Identifier: GPL-2.0+ + * SPDX-License-Identifier: GPL-2.0+ */ #include @@ -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; }