• R/O
  • HTTP
  • SSH
  • HTTPS

提交

標籤
無標籤

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Commit MetaInfo

修訂e33879a45ed3c3c0f9f19f6c658ae4ac6683e42d (tree)
時間2022-07-21 14:46:10
作者Pali Rohár <pali@kern...>
CommiterStefan Roese

Log Message

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>

Change Summary

差異

--- a/board/CZ.NIC/turris_atsha_otp.c
+++ b/board/CZ.NIC/turris_atsha_otp.c
@@ -6,6 +6,7 @@
66
77 #include <env.h>
88 #include <net.h>
9+#include <dm/device.h>
910 #include <dm/uclass.h>
1011 #include <atsha204a-i2c.h>
1112
@@ -16,12 +17,14 @@
1617 #define TURRIS_ATSHA_OTP_MAC0 3
1718 #define TURRIS_ATSHA_OTP_MAC1 4
1819
20+extern U_BOOT_DRIVER(atsha204);
21+
1922 static struct udevice *get_atsha204a_dev(void)
2023 {
2124 /* Cannot be static because BSS does not have to be ready at this early stage */
2225 struct udevice *dev;
2326
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)) {
2528 puts("Cannot find ATSHA204A on I2C bus!\n");
2629 dev = NULL;
2730 }