[U-Boot] [PATCH 3/6] i2c: fsl_i2c: i2c_read(): dont try to write address w/ alen=0

Fabio Estevam festevam at gmail.com
Mon Apr 22 18:09:54 CEST 2013


On Mon, Apr 22, 2013 at 8:06 AM, Dirk Eibach <eibach at gdsys.de> wrote:

> diff --git a/drivers/i2c/fsl_i2c.c b/drivers/i2c/fsl_i2c.c
> index 1c7265d..276386d 100644
> --- a/drivers/i2c/fsl_i2c.c
> +++ b/drivers/i2c/fsl_i2c.c
> @@ -383,13 +383,16 @@ i2c_read(u8 dev, uint addr, int alen, u8 *data, int length)
>         int i = -1; /* signal error */
>         u8 *a = (u8*)&addr;
>
> -       if (i2c_wait4bus() >= 0
> +       if (i2c_wait4bus() < 0)
> +               return -1;

Can you return a more descriptive error code here?


More information about the U-Boot mailing list