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

Fix to return a negative error code -ENODEV instead of 0 as before
commit 09721ba6da ("usb: musb: da8xx: Call earlier
clk_prepare_enable()") did.

Signed-off-by: Wang Yufen <wangyufen@huawei.com>
Link: https://lore.kernel.org/r/1669473332-14165-1-git-send-email-wangyufen@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Wang Yufen 2022-11-26 22:35:32 +08:00 committed by Greg Kroah-Hartman
parent b566d38857
commit 0376aa6232
1 changed files with 3 additions and 1 deletions

View File

@ -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)) {