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 <[email protected]>
---

  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)
"

Reply via email to