[PATCH v2 5/7] usb: onboard-hub: Bail out if peer hub is already probed

Marek Vasut marex at denx.de
Fri Sep 27 22:41:46 CEST 2024


On 9/27/24 9:01 AM, Venkatesh Yadav Abbarapu wrote:
> The .bind function is implemented to bind the correct
> "half" of the hub that the driver wants to bind,
> and returning -ENODEV for the other "half".
> 
> Signed-off-by: Venkatesh Yadav Abbarapu <venkatesh.abbarapu at amd.com>
> ---
>   common/usb_onboard_hub.c | 20 ++++++++++++++++++++
>   1 file changed, 20 insertions(+)
> 
> diff --git a/common/usb_onboard_hub.c b/common/usb_onboard_hub.c
> index 00808ed45e..9c50ca09c9 100644
> --- a/common/usb_onboard_hub.c
> +++ b/common/usb_onboard_hub.c
> @@ -162,6 +162,25 @@ err:
>   	return ret;
>   }
>   
> +static int usb_onboard_hub_bind(struct udevice *dev)
> +{
> +	struct ofnode_phandle_args phandle;
> +	const void *fdt = gd->fdt_blob;
> +	int ret, off;
> +
> +	if (dev_read_phandle_with_args(dev, "peer-hub", NULL, 0, 0, &phandle)) {

Return the error code:

ret = dev_read_phandle_with_args()
if (ret) {
...
return ret;
}

> +		dev_err(dev, "peer-hub not specified\n");
> +		return -ENOENT;
> +	}
> +
> +	off = ofnode_to_offset(phandle.node);
> +	ret = fdt_node_check_compatible(fdt, off, "usb424,5744");

return fdt_node_check_compatible(...);


More information about the U-Boot mailing list