U-Boot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Zixun LI <admin@hifiphile.com>
To: Simon Glass <sjg@chromium.org>, Tom Rini <trini@konsulko.com>,
	Lukasz Majewski <lukma@denx.de>,
	Mattijs Korpershoek <mkorpershoek@baylibre.com>,
	Marek Vasut <marex@denx.de>
Cc: Zixun LI <admin@hifiphile.com>, u-boot@lists.denx.de
Subject: [RFC PATCH 3/4] cmd: bind: Use device sequence instead for driver bind/unbind
Date: Wed, 31 Jul 2024 15:42:18 +0200	[thread overview]
Message-ID: <20240731134257.686017-4-admin@hifiphile.com> (raw)
In-Reply-To: <20240731134257.686017-1-admin@hifiphile.com>

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@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


  parent reply	other threads:[~2024-07-31 21:11 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-31 13:42 [RFC PATCH 0/4] dm: Duplicate uclass name fix and alias improvements Zixun LI
2024-07-31 13:42 ` [RFC PATCH 1/4] dm: core: Add a way to specify an alt name for alias sequence numbering Zixun LI
2024-07-31 13:42 ` [RFC PATCH 2/4] dm: core: Show device sequence instead in dm_dump_tree() Zixun LI
2024-08-01 14:42   ` Simon Glass
2024-07-31 13:42 ` Zixun LI [this message]
2024-08-01 14:42   ` [RFC PATCH 3/4] cmd: bind: Use device sequence instead for driver bind/unbind Simon Glass
2024-07-31 13:42 ` [RFC PATCH 4/4] usb: gadget: udc: Fix duplicate uclass name Zixun LI
2024-08-01 14:42 ` [RFC PATCH 0/4] dm: Duplicate uclass name fix and alias improvements Simon Glass
2024-08-01 18:37   ` Zixun LI
2024-08-01 19:28     ` Simon Glass

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240731134257.686017-4-admin@hifiphile.com \
    --to=admin@hifiphile.com \
    --cc=lukma@denx.de \
    --cc=marex@denx.de \
    --cc=mkorpershoek@baylibre.com \
    --cc=sjg@chromium.org \
    --cc=trini@konsulko.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox