[U-Boot] [PATCH 1/2] xilinx_xiic: fix fill tx fifo loop

Michal Simek michal.simek at xilinx.com
Tue Jun 25 10:47:35 UTC 2019


On 25. 06. 19 11:59, Melin Tomas wrote:
> Comparison should be against the actual message length, not loop index.
> 
> Signed-off-by: Tomas Melin <tomas.melin at vaisala.com>
> ---
>  drivers/i2c/xilinx_xiic.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/i2c/xilinx_xiic.c b/drivers/i2c/xilinx_xiic.c
> index 83114ed510..e4ca0ab936 100644
> --- a/drivers/i2c/xilinx_xiic.c
> +++ b/drivers/i2c/xilinx_xiic.c
> @@ -149,7 +149,7 @@ static void xiic_fill_tx_fifo(struct xilinx_xiic_priv *priv,
>  	while (len--) {
>  		u16 data = msg->buf[pos++];
>  
> -		if (pos == len && nmsgs == 1) {
> +		if ((msg->len - pos == 0) && nmsgs == 1) {
>  			/* last message in transfer -> STOP */
>  			data |= XIIC_TX_DYN_STOP_MASK;
>  		}
> 

DP: Can you please take a look at these 2 patches?

Thanks,
Michal


More information about the U-Boot mailing list