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

From: Pengpeng Hou

Date: Sat Sep 05 2026 - 23:43:44 EST


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 <hppiscas@xxxxxxx>
---
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)