[PATCH 1/3] usb: musb: omap2430: Propagate PHY errors from init

DORMANTno replies

From: Pengpeng Hou <hidden>
Date: 2026-09-06 03:42:15
Also in: linux-omap, lkml
Subsystem: musb multipoint high speed dual-role controller, omap usb support, the rest, usb subsystem · Maintainers: Bin Liu, Linus Torvalds, Greg Kroah-Hartman

omap2430_musb_init() ignores phy_init() and phy_power_on() failures and
continues to access the glue registers.

Return an initialization error before touching those registers. If power-on
fails after a successful initialization, exit the PHY before returning.

The issue was found by our static-analysis tool and manually reviewed.

Fixes: 3e3101d57c50 ("usb: musb: omap2430: use the new generic PHY framework")
Assisted-by: gpt 5
Signed-off-by: Pengpeng Hou <redacted>
---
 drivers/usb/musb/omap2430.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/drivers/usb/musb/omap2430.c b/drivers/usb/musb/omap2430.c
index 6e749faac33c..52fcbd209c66 100644
--- a/drivers/usb/musb/omap2430.c
+++ b/drivers/usb/musb/omap2430.c
@@ -222,8 +222,15 @@ static int omap2430_musb_init(struct musb *musb)
 		return PTR_ERR(musb->phy);
 	}
 	musb->isr = omap2430_musb_interrupt;
-	phy_init(musb->phy);
-	phy_power_on(musb->phy);
+	status = phy_init(musb->phy);
+	if (status)
+		return status;
+
+	status = phy_power_on(musb->phy);
+	if (status) {
+		phy_exit(musb->phy);
+		return status;
+	}
 
 	l = musb_readl(musb->mregs, OTG_INTERFSEL);
 
-- 
2.50.1 (Apple Git-155)
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help