[PATCH 1/5] usb: ohci-generic: ignore ENOSYS and ENOTSUPP errors from clk and reset
Marek Vasut
marex at denx.de
Fri Jan 26 10:29:13 CET 2024
On 1/26/24 10:25, 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>
> ---
>
> 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..28512c081f 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);
This simpler form should work too I think ?
"
if (ret && ret != -ENOENT && ret != -ENOSYS)
"
More information about the U-Boot
mailing list