From 07bed7d38eb952ec2e66d94ac40a7bbcc3592cd9 Mon Sep 17 00:00:00 2001 From: Andre Przywara Date: Sat, 2 Jul 2022 01:45:10 +0100 Subject: [PATCH] usb: host: ehci-generic: Fix error check Commit b38a0ac9f2ee ("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: b38a0ac9f2ee ("usb: host: ehci-generic: Make resets and clocks optional") Signed-off-by: Andre Przywara --- 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 15267e9a05..75c73bfe4e 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 (ret && ret != -ENOENT) { + if (err && err != -ENOENT) { dev_err(dev, "Failed to get resets (err=%d)\n", err); goto clk_err; } -- 2.39.5