[PATCH] usb: imx: Do not disable VBUS on ehci_register()'s success

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Original code was written to exit early on ehci_register()'s
success. As a part of e3eb0c729b, however, it was modified to to early
exit on failure instead. This resulted in VBUS being erroneously
disabled after EHCI controller was added, thus breaking USB on some
i.MX boards (confirmed on ZII's RDU2).

Fixes: e3eb0c729b ("usb: host: ehci: add ehci_unregister()")
Signed-off-by: Andrey Smirnov <andrew.smirnov@xxxxxxxxx>
Cc: Vivien Didelot <vivien.didelot@xxxxxxxxx>
---
 drivers/usb/imx/chipidea-imx.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/usb/imx/chipidea-imx.c b/drivers/usb/imx/chipidea-imx.c
index 879221770..6c60c383f 100644
--- a/drivers/usb/imx/chipidea-imx.c
+++ b/drivers/usb/imx/chipidea-imx.c
@@ -201,14 +201,14 @@ static int ci_register_role(struct imx_chipidea *ci)
 				return ret;
 
 			ehci = ehci_register(ci->dev, &ci->data);
-			if (IS_ERR(ehci))
+			if (IS_ERR(ehci)) {
+				regulator_disable(ci->vbus);
 				return PTR_ERR(ehci);
+			}
 
 			ci->ehci = ehci;
 
 			ci->dev->detect = ci_ehci_detect;
-
-			regulator_disable(ci->vbus);
 		} else {
 			dev_err(ci->dev, "Host support not available\n");
 			return -ENODEV;
-- 
2.20.1


_______________________________________________
barebox mailing list
barebox@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/barebox



[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux