[PATCH] misc: atsha204a: Fix big endian support

Stefan Roese sr at denx.de
Mon Apr 4 09:43:21 CEST 2022


On 4/3/22 00:36, Pali Rohár wrote:
> Callers of function atsha204a_crc16() expect to return value in host cpu
> endianity. So remove cpu_to_le16() conversion.
> 
> Signed-off-by: Pali Rohár <pali at kernel.org>

Reviewed-by: Stefan Roese <sr at denx.de>

Thanks,
Stefan

> ---
>   drivers/misc/atsha204a-i2c.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/misc/atsha204a-i2c.c b/drivers/misc/atsha204a-i2c.c
> index b89463babb56..63fe541dade3 100644
> --- a/drivers/misc/atsha204a-i2c.c
> +++ b/drivers/misc/atsha204a-i2c.c
> @@ -146,7 +146,7 @@ static u16 atsha204a_crc16(const u8 *buffer, size_t len)
>   	while (len--)
>   		crc = crc16_byte(crc, *buffer++);
>   
> -	return cpu_to_le16(crc);
> +	return crc;
>   }
>   
>   static int atsha204a_send(struct udevice *dev, const u8 *buf, u8 len)

Viele Grüße,
Stefan Roese

-- 
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: sr at denx.de


More information about the U-Boot mailing list