[RFC PATCH 3/4] cmd: bind: Use device sequence instead for driver bind/unbind

Zixun LI admin at hifiphile.com
Wed Jul 31 15:42:18 CEST 2024


Currently uclass index is used for bind/unbind which ignores alias
sequence numbering. Use device sequence number instead as it's
the number explicitly set in the DT.

Signed-off-by: Zixun LI <admin at hifiphile.com>
---
 cmd/bind.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/cmd/bind.c b/cmd/bind.c
index 3a59eefd5c..30f1163e17 100644
--- a/cmd/bind.c
+++ b/cmd/bind.c
@@ -31,7 +31,7 @@ static int bind_by_class_index(const char *uclass, int index,
 		return -EINVAL;
 	}
 
-	ret = uclass_find_device(uclass_id, index, &parent);
+	ret = uclass_find_device_by_seq(uclass_id, index, &parent);
 	if (!parent || ret) {
 		printf("Cannot find device %d of class %s\n", index, uclass);
 		return ret;
@@ -58,7 +58,7 @@ static int find_dev(const char *uclass, int index, struct udevice **devp)
 		return -EINVAL;
 	}
 
-	rc = uclass_find_device(uclass_id, index, devp);
+	rc = uclass_find_device_by_seq(uclass_id, index, devp);
 	if (!*devp || rc) {
 		printf("Cannot find device %d of class %s\n", index, uclass);
 		return rc;
-- 
2.45.2



More information about the U-Boot mailing list