[PATCH v2] usb: onboard-hub: Update the bind function based on peer-hub property
Michal Simek
michal.simek at amd.com
Wed Dec 4 08:08:00 CET 2024
+Patrice
On 12/4/24 05:39, Venkatesh Yadav Abbarapu wrote:
> As the "peer-hub" property is optional, don't error out just
> skip the bind function.
>
> Signed-off-by: Venkatesh Yadav Abbarapu <venkatesh.abbarapu at amd.com>
> ---
> Changes in v2:
> - Removed the peer_hub variable and used the return value.
> ---
> common/usb_onboard_hub.c | 6 +++++-
> 1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/common/usb_onboard_hub.c b/common/usb_onboard_hub.c
> index 6f28036e09..be83f168e1 100644
> --- a/common/usb_onboard_hub.c
> +++ b/common/usb_onboard_hub.c
> @@ -183,7 +183,11 @@ static int usb_onboard_hub_bind(struct udevice *dev)
> int ret, off;
>
> ret = dev_read_phandle_with_args(dev, "peer-hub", NULL, 0, 0, &phandle);
> - if (ret) {
> +
no need for this newline.
> + if (ret == -ENOENT) {
> + dev_dbg(dev, "peer-hub property not present\n");
> + return 0;
> + } else
This else is not needed. Write it like this.
if (ret == -ENOENT) {
...
return 0
}
if (ret) {
...
return ret;
}
if (ret) {
> dev_err(dev, "peer-hub not specified\n");
> return ret;
> }
Patrice: Can you please try this patch to see if fixes your problem?
Thanks,
Michal
More information about the U-Boot
mailing list