[PATCH v2 1/5] usb: ohci-generic: ignore ENOSYS and ENOTSUPP errors from clk and reset

Marek Vasut marex at denx.de
Mon Feb 19 15:05:43 CET 2024


On 2/19/24 12:59, Piotr Wojtaszczyk wrote:
> If a machine doesn't have CONFIG_CLK set the call to clk_get_bulk()
> returns '-ENOSYS' error which should be handled the same way as
> '-ENOENT' error. The same applies to reset_get_bulk() and 'ENOTSUPP'.
> 
> Signed-off-by: Piotr Wojtaszczyk <piotr.wojtaszczyk at timesys.com>
> ---
> Changes for v2:
> - Changed logic style from !(== || ==) to (!= && !=)
> 
>   drivers/usb/host/ohci-generic.c | 12 ++++++++----
>   1 file changed, 8 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/usb/host/ohci-generic.c b/drivers/usb/host/ohci-generic.c
> index ceed1911a9..8740094afc 100644
> --- a/drivers/usb/host/ohci-generic.c
> +++ b/drivers/usb/host/ohci-generic.c
> @@ -28,7 +28,7 @@ static int ohci_usb_probe(struct udevice *dev)
>   	int err, ret;
>   
>   	ret = clk_get_bulk(dev, &priv->clocks);
> -	if (ret && ret != -ENOENT) {
> +	if (ret && ret != -ENOENT && ret != -ENOSYS) {
>   		dev_err(dev, "Failed to get clocks (ret=%d)\n", ret);
>   		return ret;
>   	}
> @@ -40,7 +40,7 @@ static int ohci_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;
>   	}
> @@ -72,7 +72,7 @@ reset_err:
>   		dev_err(dev, "failed to release resets (ret=%d)\n", ret);
>   clk_err:
>   	ret = clk_release_bulk(&priv->clocks);
> -	if (ret)
> +	if (ret && (ret != -ENOSYS))

The extra parenthesis are not needed I think, the rest of the patch 
seems OK, thanks !


More information about the U-Boot mailing list