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

Simon Glass sjg at chromium.org
Thu Aug 1 16:42:24 CEST 2024


Hi Zixun,

On Wed, 31 Jul 2024 at 07:43, Zixun LI <admin at hifiphile.com> wrote:
>
> 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(-)
>

I assume no tests need updating, but please do add a note to
doc/usage/cmd/bind.rst

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

Regards,
Simon


More information about the U-Boot mailing list