diff mbox series

usb: phy: tahvo: Check before clk_disable() not needed

Message ID 20220610074525.69453-1-hanyihao@vivo.com (mailing list archive)
State New, archived
Headers show
Series usb: phy: tahvo: Check before clk_disable() not needed | expand

Commit Message

Yihao Han June 10, 2022, 7:45 a.m. UTC
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(-)

Comments

Greg KH June 10, 2022, 9:01 a.m. UTC | #1
On Fri, Jun 10, 2022 at 12:45:25AM -0700, Yihao Han wrote:
> clk_disable() already checks the clk ptr using IS_ERR_OR_NULL(clk)

It does?  Are you sure?  It will check for NULL, that's it.

> so there is no need to check it again before calling it.

This will break on some platforms, please always test your patches
before sending them out.

thanks,

greg k-h
diff mbox series

Patch

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;
 }