All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] usb: host: ehci-generic: Fix error check
@ 2022-07-02  0:45 Andre Przywara
  2022-07-02 21:42 ` Marek Vasut
  2022-07-04 12:19 ` Tom Rini
  0 siblings, 2 replies; 4+ messages in thread
From: Andre Przywara @ 2022-07-02  0:45 UTC (permalink / raw)
  To: Marek Vasut, Tom Rini, Simon Glass; +Cc: Patrice Chotard, u-boot

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

diff --git a/drivers/usb/host/ehci-generic.c b/drivers/usb/host/ehci-generic.c
index 15267e9a05a..75c73bfe4e8 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.35.3


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] usb: host: ehci-generic: Fix error check
  2022-07-02  0:45 [PATCH] usb: host: ehci-generic: Fix error check Andre Przywara
@ 2022-07-02 21:42 ` Marek Vasut
  2022-07-03  0:08   ` Tom Rini
  2022-07-04 12:19 ` Tom Rini
  1 sibling, 1 reply; 4+ messages in thread
From: Marek Vasut @ 2022-07-02 21:42 UTC (permalink / raw)
  To: Andre Przywara, Tom Rini, Simon Glass; +Cc: Patrice Chotard, u-boot

On 7/2/22 02:45, Andre Przywara wrote:
> 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>
> ---
> 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 ?

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] usb: host: ehci-generic: Fix error check
  2022-07-02 21:42 ` Marek Vasut
@ 2022-07-03  0:08   ` Tom Rini
  0 siblings, 0 replies; 4+ messages in thread
From: Tom Rini @ 2022-07-03  0:08 UTC (permalink / raw)
  To: Marek Vasut; +Cc: Andre Przywara, Simon Glass, Patrice Chotard, u-boot

[-- Attachment #1: Type: text/plain, Size: 1000 bytes --]

On Sat, Jul 02, 2022 at 11:42:17PM +0200, Marek Vasut wrote:
> On 7/2/22 02:45, Andre Przywara wrote:
> > 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>
> > ---
> > 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 ?

OK.

-- 
Tom

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] usb: host: ehci-generic: Fix error check
  2022-07-02  0:45 [PATCH] usb: host: ehci-generic: Fix error check Andre Przywara
  2022-07-02 21:42 ` Marek Vasut
@ 2022-07-04 12:19 ` Tom Rini
  1 sibling, 0 replies; 4+ messages in thread
From: Tom Rini @ 2022-07-04 12:19 UTC (permalink / raw)
  To: Andre Przywara; +Cc: Marek Vasut, Simon Glass, Patrice Chotard, u-boot

[-- Attachment #1: Type: text/plain, Size: 633 bytes --]

On Sat, Jul 02, 2022 at 01:45:10AM +0100, Andre Przywara wrote:

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

Applied to u-boot/master, thanks!

-- 
Tom

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-07-04 12:19 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-02  0:45 [PATCH] usb: host: ehci-generic: Fix error check Andre Przywara
2022-07-02 21:42 ` Marek Vasut
2022-07-03  0:08   ` Tom Rini
2022-07-04 12:19 ` Tom Rini

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.