]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
cmd: eeprom: Do not rewrite EEPROM I2C bus with DM I2C enabled
authorMarek Vasut <marex@denx.de>
Wed, 16 Feb 2022 14:27:59 +0000 (15:27 +0100)
committerHeiko Schocher <hs@denx.de>
Wed, 23 Mar 2022 06:27:37 +0000 (07:27 +0100)
With DM I2C, the EEPROM bus has been correctly configured in
eeprom_execute_command() already. Do not reconfigure it here
with hard-coded bus number again.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Heiko Schocher <hs@denx.de>
Cc: Tom Rini <trini@konsulko.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
cmd/eeprom.c

index cdd65af763b04f13d08386d52c9490f67f209aca..fc0d4440694016140e8177de08de10c332508bda 100644 (file)
@@ -149,7 +149,7 @@ static int eeprom_rw(unsigned dev_addr, unsigned offset, uchar *buffer,
        int rcode = 0;
        uchar addr[3];
 
-#if defined(CONFIG_SYS_I2C_EEPROM_BUS)
+#if !CONFIG_IS_ENABLED(DM_I2C) && defined(CONFIG_SYS_I2C_EEPROM_BUS)
        eeprom_init(CONFIG_SYS_I2C_EEPROM_BUS);
 #endif