diff mbox series

usb: musb: fix error return code in da8xx_musb_init()

Message ID 1669473332-14165-1-git-send-email-wangyufen@huawei.com
State New
Headers show
Series usb: musb: fix error return code in da8xx_musb_init() | expand

Commit Message

wangyufen Nov. 26, 2022, 2:35 p.m. UTC
Fix to return a negative error code -ENODEV instead of 0 as before
commit 09721ba6daa1 ("usb: musb: da8xx: Call earlier
clk_prepare_enable()") did.

Fixes: 09721ba6daa1 ("usb: musb: da8xx: Call earlier clk_prepare_enable()")
Signed-off-by: Wang Yufen <wangyufen@huawei.com>
---
 drivers/usb/musb/da8xx.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/drivers/usb/musb/da8xx.c b/drivers/usb/musb/da8xx.c
index a4e55b0..d47e5c9 100644
--- a/drivers/usb/musb/da8xx.c
+++ b/drivers/usb/musb/da8xx.c
@@ -368,8 +368,10 @@  static int da8xx_musb_init(struct musb *musb)
 
 	/* Returns zero if e.g. not clocked */
 	rev = musb_readl(reg_base, DA8XX_USB_REVISION_REG);
-	if (!rev)
+	if (!rev) {
+		ret = -ENODEV;
 		goto fail;
+	}
 
 	musb->xceiv = usb_get_phy(USB_PHY_TYPE_USB2);
 	if (IS_ERR_OR_NULL(musb->xceiv)) {