aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPali Rohár <pali@kernel.org>2022-04-08 16:30:13 +0200
committerStefan Roese <sr@denx.de>2022-04-21 12:31:36 +0200
commitada791db3eb13ad5ac0447c8c8b0343c4d771fb9 (patch)
treeb010af51d514258e54091c4ef50d41090bb95d9e
parent6ac08dc1a83d786d8749525df32c94b94bb36123 (diff)
downloadu-boot-ada791db3eb13ad5ac0447c8c8b0343c4d771fb9.zip
u-boot-ada791db3eb13ad5ac0447c8c8b0343c4d771fb9.tar.gz
u-boot-ada791db3eb13ad5ac0447c8c8b0343c4d771fb9.tar.bz2
board: turris: Do not cache Atsha device in BSS
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@kernel.org> Reviewed-by: Marek Behún <marek.behun@nic.cz>
-rw-r--r--board/CZ.NIC/turris_atsha_otp.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/board/CZ.NIC/turris_atsha_otp.c b/board/CZ.NIC/turris_atsha_otp.c
index a4a77c7..840721a 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@64", &dev)) {
puts("Cannot find ATSHA204A on I2C bus!\n");