[PATCH] usb: host: ehci-vf: Fix portnr initialization

Simon Glass sjg at chromium.org
Thu Mar 4 04:46:54 CET 2021


Hi Dominik,

On Thu, 4 Feb 2021 at 06:01, Dominik Wild <dominik.wild at gmail.com> wrote:
>
> As of 29f7d05a347ab7a42577c67fdfb787ef91537302 dev->seq will be set
> after device_ofdata_to_platdata(), therefore dev->seq must be read
> later during probe
>
> Signed-off-by: Dominik Wild <dominik.wild at gmail.com>
> ---
>  drivers/usb/host/ehci-vf.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/usb/host/ehci-vf.c b/drivers/usb/host/ehci-vf.c
> index 25f76c9fa9..4dac940d08 100644
> --- a/drivers/usb/host/ehci-vf.c
> +++ b/drivers/usb/host/ehci-vf.c
> @@ -222,8 +222,6 @@ static int vf_usb_of_to_plat(struct udevice *dev)
>         int node = dev_of_offset(dev);
>         const char *mode;
>
> -       priv->portnr = dev_seq(dev);
> -
>         priv->ehci = dev_read_addr_ptr(dev);
>         mode = fdt_getprop(dt_blob, node, "dr_mode", NULL);
>         if (mode) {
> @@ -317,6 +315,8 @@ static int ehci_usb_probe(struct udevice *dev)
>         struct ehci_hcor *hcor;
>         int ret;
>
> +       priv->portnr = dev_seq(dev);
> +
>         ret = ehci_vf_common_init(ehci, priv->portnr);
>         if (ret)
>                 return ret;
> --
> 2.25.1
>

I am a bit surprised at this...the sequence number should normally be
set during the bind step. Is this missing from USB binding? I can't
recall how it works right now.

Regards,
Simon


More information about the U-Boot mailing list