[PATCH] usb: host: ehci-generic: Handle DM_RESET=n case

Patrice CHOTARD patrice.chotard at foss.st.com
Tue Jan 24 09:07:58 CET 2023


Hi Marek

On 1/23/23 23:32, Marek Vasut wrote:
> In case CONFIG_DM_RESET=n, reset_get_bulk() returns -ENOTSUPP.
> Do not fail in that case either. This is a valid use case, e.g.
> in case the reset driver is a no-op and would only waste space
> in the build.
> 
> Fixes: 81755b8c20f ("usb: host: ehci-generic: Make resets and clocks optional")
> Signed-off-by: Marek Vasut <marek.vasut+renesas at mailbox.org>
> ---
> Cc: Andre Przywara <andre.przywara at arm.com>
> Cc: Patrice Chotard <patrice.chotard at foss.st.com>
> ---
>  drivers/usb/host/ehci-generic.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/usb/host/ehci-generic.c b/drivers/usb/host/ehci-generic.c
> index a765a307a32..83fe701ff67 100644
> --- a/drivers/usb/host/ehci-generic.c
> +++ b/drivers/usb/host/ehci-generic.c
> @@ -81,7 +81,7 @@ static int ehci_usb_probe(struct udevice *dev)
>  	}
>  
>  	err = reset_get_bulk(dev, &priv->resets);
> -	if (err && err != -ENOENT) {
> +	if (err && err != -ENOENT && err != -ENOTSUPP) {
>  		dev_err(dev, "Failed to get resets (err=%d)\n", err);
>  		goto clk_err;
>  	}

A similar patch can be applied for testing return value of clk_get_bulk() ?
In case CONFIG_CLK is not set, clk_get_bulk() can return -ENOSYS.

Reviewed-by: Patrice Chotard <patrice.chotard at foss.st.com>

Thanks
Patrice


More information about the U-Boot mailing list