From: Biwen Li Date: Mon, 26 Oct 2020 07:14:05 +0000 (+0800) Subject: board/freescale/common: fix a bug that failed to read/write eeprom on ls1021atsn X-Git-Url: http://git.dujemihanovic.xyz/img/sics.gif?a=commitdiff_plain;h=e343ae7c967f5386f97fc9087383b54ed1967786;p=u-boot.git board/freescale/common: fix a bug that failed to read/write eeprom on ls1021atsn Fix a bug that failed to read/write eeprom on ls1021atsn Signed-off-by: Biwen Li Tested-by: Vladimir Oltean Reviewed-by: Priyanka Jain --- diff --git a/board/freescale/common/sys_eeprom.c b/board/freescale/common/sys_eeprom.c index 728245d81c..33ae4c15ba 100644 --- a/board/freescale/common/sys_eeprom.c +++ b/board/freescale/common/sys_eeprom.c @@ -175,9 +175,11 @@ static int read_eeprom(void) struct udevice *dev; #ifdef CONFIG_SYS_EEPROM_BUS_NUM ret = i2c_get_chip_for_busnum(CONFIG_SYS_EEPROM_BUS_NUM, - CONFIG_SYS_I2C_EEPROM_ADDR, 1, &dev); + CONFIG_SYS_I2C_EEPROM_ADDR, + CONFIG_SYS_I2C_EEPROM_ADDR_LEN, &dev); #else - ret = i2c_get_chip_for_busnum(0, CONFIG_SYS_I2C_EEPROM_ADDR, 1, &dev); + ret = i2c_get_chip_for_busnum(0, CONFIG_SYS_I2C_EEPROM_ADDR, + CONFIG_SYS_I2C_EEPROM_ADDR_LEN, &dev); #endif if (!ret) ret = dm_i2c_read(dev, 0, (void *)&e, sizeof(e));