修訂 | e33879a45ed3c3c0f9f19f6c658ae4ac6683e42d (tree) |
---|---|
時間 | 2022-07-21 14:46:10 |
作者 | Pali Rohár <pali@kern...> |
Commiter | Stefan Roese |
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 <pali@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>
@@ -6,6 +6,7 @@ | ||
6 | 6 | |
7 | 7 | #include <env.h> |
8 | 8 | #include <net.h> |
9 | +#include <dm/device.h> | |
9 | 10 | #include <dm/uclass.h> |
10 | 11 | #include <atsha204a-i2c.h> |
11 | 12 |
@@ -16,12 +17,14 @@ | ||
16 | 17 | #define TURRIS_ATSHA_OTP_MAC0 3 |
17 | 18 | #define TURRIS_ATSHA_OTP_MAC1 4 |
18 | 19 | |
20 | +extern U_BOOT_DRIVER(atsha204); | |
21 | + | |
19 | 22 | static struct udevice *get_atsha204a_dev(void) |
20 | 23 | { |
21 | 24 | /* Cannot be static because BSS does not have to be ready at this early stage */ |
22 | 25 | struct udevice *dev; |
23 | 26 | |
24 | - if (uclass_get_device_by_name(UCLASS_MISC, "crypto@64", &dev)) { | |
27 | + if (uclass_get_device_by_driver(UCLASS_MISC, DM_DRIVER_GET(atsha204), &dev)) { | |
25 | 28 | puts("Cannot find ATSHA204A on I2C bus!\n"); |
26 | 29 | dev = NULL; |
27 | 30 | } |