All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mingwei Zheng <zmw12306@gmail.com>
To: gregkh@linuxfoundation.org, u.kleine-koenig@baylibre.com,
	aaro.koskinen@iki.fi, balbi@ti.com
Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
	Mingwei Zheng <zmw12306@gmail.com>,
	Jiasheng Jiang <jiashengjiangcool@gmail.com>
Subject: [PATCH] USB: phy: tahvo: Add check for clk_enable()
Date: Sun, 15 Dec 2024 16:00:06 -0500	[thread overview]
Message-ID: <20241215210006.4114454-1-zmw12306@gmail.com> (raw)

Add check for the return value of clk_enable() to catch the potential
error.

Fixes: 9ba96ae5074c ("usb: omap1: Tahvo USB transceiver driver")
Signed-off-by: Mingwei Zheng <zmw12306@gmail.com>
Signed-off-by: Jiasheng Jiang <jiashengjiangcool@gmail.com>
---
 drivers/usb/phy/phy-tahvo.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/phy/phy-tahvo.c b/drivers/usb/phy/phy-tahvo.c
index ae7bf3ff89ee..0b8801318cd2 100644
--- a/drivers/usb/phy/phy-tahvo.c
+++ b/drivers/usb/phy/phy-tahvo.c
@@ -342,8 +342,11 @@ static int tahvo_usb_probe(struct platform_device *pdev)
 	mutex_init(&tu->serialize);
 
 	tu->ick = devm_clk_get(&pdev->dev, "usb_l4_ick");
-	if (!IS_ERR(tu->ick))
-		clk_enable(tu->ick);
+	if (!IS_ERR(tu->ick)) {
+		ret = clk_enable(tu->ick);
+		if (ret)
+			return ret;
+	}
 
 	/*
 	 * Set initial state, so that we generate kevents only on state changes.
-- 
2.34.1


             reply	other threads:[~2024-12-15 20:56 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-15 21:00 Mingwei Zheng [this message]
2024-12-16  7:56 ` [PATCH] USB: phy: tahvo: Add check for clk_enable() Greg KH
2024-12-18  3:09   ` Mingwei Zheng

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=20241215210006.4114454-1-zmw12306@gmail.com \
    --to=zmw12306@gmail.com \
    --cc=aaro.koskinen@iki.fi \
    --cc=balbi@ti.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jiashengjiangcool@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=u.kleine-koenig@baylibre.com \
    /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.