Skip to contentSkip to conversation

usb: host: ehci-generic: Fix error check

PATCH In review Andre Przywara 3 participants 4 messages Jul 2, 2022 – Jul 4, 2022

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 usb: host: ehci-generic: Fix error check

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

---
Hi,

apologies for messing up this simple patch of mine last month. I got confused by the mixed usage of "ret" and "err" in this function. This might endorse some cleanup, but I don't dare to touch this file again, especially not that late in the cycle.

Cheers,
Andre

 drivers/usb/host/ehci-generic.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/host/ehci-generic.c +1 -1
index 15267e9a05a..75c73bfe4e8 100644
@@ -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;
 	}
Signature · 1 line
2.35.3
#1 lore raw
Quoted 10 lines · Andre Przywara

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

---
Hi,

apologies for messing up this simple patch of mine last month. I got confused by the mixed usage of "ret" and "err" in this function. This might endorse some cleanup, but I don't dare to touch this file again, especially not that late in the cycle.

Tom, can you pick this patch directly ?

Andre, can you send the ret/err cleanup patch as a follow up , so it can be picked after release ?

#2 lore raw
Quoted 14 lines · Marek Vasut
Quoted 13 lines · Andre Przywara

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

---
Hi,

Quoted 6 lines
Quoted 4 lines

apologies for messing up this simple patch of mine last month. I got confused by the mixed usage of "ret" and "err" in this function. This might endorse some cleanup, but I don't dare to touch this file again, especially not that late in the cycle.

Tom, can you pick this patch directly ?

OK.

Signature · 1 line
Tom
#3 lore raw
In reply to Andre Przywara
Quoted 10 lines · Andre Przywara

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

Applied to u-boot/master, thanks!

Signature · 1 line
Tom