[PATCH 2/4] board: turris: Do not cache Atsha device in BSS

Stefan Roese sr at denx.de
Thu Apr 21 16:14:43 CEST 2022


On 4/8/22 16:30, Pali Rohár wrote:
> Atsha device is used prior relocation and at this early stage BSS does not
> have to be ready yet. So do not cache Atsha device in BSS.
> 
> Fixes support for other Turris routers.
> 
> Signed-off-by: Pali Rohár <pali at kernel.org>

Applied to u-boot-marvell/master

Thanks,
Stefan

> ---
>   board/CZ.NIC/turris_atsha_otp.c | 6 ++----
>   1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/board/CZ.NIC/turris_atsha_otp.c b/board/CZ.NIC/turris_atsha_otp.c
> index a4a77c74fb19..840721a9b737 100644
> --- a/board/CZ.NIC/turris_atsha_otp.c
> +++ b/board/CZ.NIC/turris_atsha_otp.c
> @@ -18,10 +18,8 @@
>   
>   static struct udevice *get_atsha204a_dev(void)
>   {
> -	static struct udevice *dev;
> -
> -	if (dev)
> -		return dev;
> +	/* Cannot be static because BSS does not have to be ready at this early stage */
> +	struct udevice *dev;
>   
>   	if (uclass_get_device_by_name(UCLASS_MISC, "atsha204a at 64", &dev)) {
>   		puts("Cannot find ATSHA204A on I2C bus!\n");

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