diff mbox series

board/freescale/common: fix a bug that failed to read/write eeprom on ls1021atsn

Message ID 20201026071405.8899-1-biwen.li@oss.nxp.com
State Under Review
Delegated to: Priyanka Jain
Headers show
Series board/freescale/common: fix a bug that failed to read/write eeprom on ls1021atsn | expand

Commit Message

Biwen Li (OSS) Oct. 26, 2020, 7:14 a.m. UTC
From: Biwen Li <biwen.li@nxp.com>

Fix a bug that failed to read/write eeprom on ls1021atsn

Signed-off-by: Biwen Li <biwen.li@nxp.com>
---
 board/freescale/common/sys_eeprom.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

Comments

Vladimir Oltean Oct. 26, 2020, 10:33 a.m. UTC | #1
On Mon, Oct 26, 2020 at 03:14:05PM +0800, Biwen Li wrote:
> From: Biwen Li <biwen.li@nxp.com>
> 
> Fix a bug that failed to read/write eeprom on ls1021atsn
> 
> Signed-off-by: Biwen Li <biwen.li@nxp.com>
> ---

Tested-by: Vladimir Oltean <vladimir.oltean@nxp.com>

>  board/freescale/common/sys_eeprom.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/board/freescale/common/sys_eeprom.c b/board/freescale/common/sys_eeprom.c
> index c487e3a515..f14602af20 100644
> --- a/board/freescale/common/sys_eeprom.c
> +++ b/board/freescale/common/sys_eeprom.c
> @@ -173,9 +173,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));
> -- 
> 2.17.1
>
diff mbox series

Patch

diff --git a/board/freescale/common/sys_eeprom.c b/board/freescale/common/sys_eeprom.c
index c487e3a515..f14602af20 100644
--- a/board/freescale/common/sys_eeprom.c
+++ b/board/freescale/common/sys_eeprom.c
@@ -173,9 +173,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));