usb: host: ehci-generic: Fix error check
authorAndre Przywara <andre.przywara@arm.com>
Sat, 2 Jul 2022 00:45:10 +0000 (01:45 +0100)
committerTom Rini <trini@konsulko.com>
Mon, 4 Jul 2022 12:00:36 +0000 (08:00 -0400)
Commit 81755b8c20fe ("usb: host: ehci-generic: Make resets and clocks
optional") improved the error check to cover the reset property being
optional. However this was using the wrong error variable for the
check, so would now never fail.

Use the correct error variable for checking the result of
reset_get_bulk(), to actually report genuine errors.

Fixes: 81755b8c20fe ("usb: host: ehci-generic: Make resets and clocks optional")
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
drivers/usb/host/ehci-generic.c

index 15267e9..75c73bf 100644 (file)
@@ -81,7 +81,7 @@ static int ehci_usb_probe(struct udevice *dev)
        }
 
        err = reset_get_bulk(dev, &priv->resets);
-       if (ret && ret != -ENOENT) {
+       if (err && err != -ENOENT) {
                dev_err(dev, "Failed to get resets (err=%d)\n", err);
                goto clk_err;
        }