All of lore.kernel.org
 help / color / mirror / Atom feed
From: Yihao Han <hanyihao@vivo.com>
To: Felipe Balbi <balbi@kernel.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: Yihao Han <hanyihao@vivo.com>
Subject: [PATCH] usb: phy: tahvo: Check before clk_disable() not needed
Date: Fri, 10 Jun 2022 00:45:25 -0700	[thread overview]
Message-ID: <20220610074525.69453-1-hanyihao@vivo.com> (raw)

clk_disable() already checks the clk ptr using IS_ERR_OR_NULL(clk)
so there is no need to check it again before calling it.

Signed-off-by: Yihao Han <hanyihao@vivo.com>
---
 drivers/usb/phy/phy-tahvo.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/usb/phy/phy-tahvo.c b/drivers/usb/phy/phy-tahvo.c
index f2d2cc586c5b..9cecc5444515 100644
--- a/drivers/usb/phy/phy-tahvo.c
+++ b/drivers/usb/phy/phy-tahvo.c
@@ -406,8 +406,7 @@ static int tahvo_usb_probe(struct platform_device *pdev)
 err_remove_phy:
 	usb_remove_phy(&tu->phy);
 err_disable_clk:
-	if (!IS_ERR(tu->ick))
-		clk_disable(tu->ick);
+	clk_disable(tu->ick);
 
 	return ret;
 }
@@ -418,8 +417,7 @@ static int tahvo_usb_remove(struct platform_device *pdev)
 
 	free_irq(tu->irq, tu);
 	usb_remove_phy(&tu->phy);
-	if (!IS_ERR(tu->ick))
-		clk_disable(tu->ick);
+	clk_disable(tu->ick);
 
 	return 0;
 }
-- 
2.17.1


             reply	other threads:[~2022-06-10  7:46 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-10  7:45 Yihao Han [this message]
2022-06-10  9:01 ` [PATCH] usb: phy: tahvo: Check before clk_disable() not needed Greg Kroah-Hartman

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=20220610074525.69453-1-hanyihao@vivo.com \
    --to=hanyihao@vivo.com \
    --cc=balbi@kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --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.