aboutsummaryrefslogtreecommitdiff
path: root/board
diff options
context:
space:
mode:
authorPali Rohár <pali@kernel.org>2022-05-19 11:11:52 +0200
committerStefan Roese <sr@denx.de>2022-07-21 07:46:10 +0200
commite33879a45ed3c3c0f9f19f6c658ae4ac6683e42d (patch)
tree3070335ea5f3c259a0851e1bbee45f5dfac6eaf4 /board
parent88d931a71052fc8fb7b48126ae09aa875745d5ec (diff)
downloadu-boot-e33879a45ed3c3c0f9f19f6c658ae4ac6683e42d.zip
u-boot-e33879a45ed3c3c0f9f19f6c658ae4ac6683e42d.tar.gz
u-boot-e33879a45ed3c3c0f9f19f6c658ae4ac6683e42d.tar.bz2
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>
Diffstat (limited to 'board')
-rw-r--r--board/CZ.NIC/turris_atsha_otp.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/board/CZ.NIC/turris_atsha_otp.c b/board/CZ.NIC/turris_atsha_otp.c
index 8c39f5e..e62b7ee 100644
--- a/board/CZ.NIC/turris_atsha_otp.c
+++ b/board/CZ.NIC/turris_atsha_otp.c
@@ -6,6 +6,7 @@
#include <env.h>
#include <net.h>
+#include <dm/device.h>
#include <dm/uclass.h>
#include <atsha204a-i2c.h>
@@ -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;
}