From: Pali Rohár Date: Thu, 19 May 2022 09:11:52 +0000 (+0200) Subject: board: turris: Find atsha device by atsha driver X-Git-Tag: baikal/mips/sdk5.8.2~5^2~281^2~14 X-Git-Url: https://git.baikalelectronics.ru/sdk/?a=commitdiff_plain;h=892a52101f7535efd22c73b396b8402e7a7739f6;p=uboot.git board: turris: Find atsha device by atsha driver It does not matter what is DT node name of atsha device. So find it via atsha driver and not by DT node name. Signed-off-by: Pali Rohár Reviewed-by: Stefan Roese --- diff --git a/board/CZ.NIC/turris_atsha_otp.c b/board/CZ.NIC/turris_atsha_otp.c index 8c39f5e524..e62b7ee2a4 100644 --- a/board/CZ.NIC/turris_atsha_otp.c +++ b/board/CZ.NIC/turris_atsha_otp.c @@ -6,6 +6,7 @@ #include #include +#include #include #include @@ -16,12 +17,14 @@ #define TURRIS_ATSHA_OTP_MAC0 3 #define TURRIS_ATSHA_OTP_MAC1 4 +extern U_BOOT_DRIVER(atsha204); + static struct udevice *get_atsha204a_dev(void) { /* 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, "crypto@64", &dev)) { + if (uclass_get_device_by_driver(UCLASS_MISC, DM_DRIVER_GET(atsha204), &dev)) { puts("Cannot find ATSHA204A on I2C bus!\n"); dev = NULL; }