All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wang Yufen <wangyufen@huawei.com>
To: <b-liu@ti.com>, <gregkh@linuxfoundation.org>,
	<lgirdwood@gmail.com>, <broonie@kernel.org>
Cc: <linux-usb@vger.kernel.org>, <abailon@baylibre.com>,
	Wang Yufen <wangyufen@huawei.com>
Subject: [PATCH] usb: musb: fix error return code in da8xx_musb_init()
Date: Sat, 26 Nov 2022 22:35:32 +0800	[thread overview]
Message-ID: <1669473332-14165-1-git-send-email-wangyufen@huawei.com> (raw)

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


                 reply	other threads:[~2022-11-26 14:15 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1669473332-14165-1-git-send-email-wangyufen@huawei.com \
    --to=wangyufen@huawei.com \
    --cc=abailon@baylibre.com \
    --cc=b-liu@ti.com \
    --cc=broonie@kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-usb@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.