* [PATCH] usb: phy: tahvo: Check before clk_disable() not needed
@ 2022-06-10 7:45 Yihao Han
2022-06-10 9:01 ` Greg Kroah-Hartman
0 siblings, 1 reply; 2+ messages in thread
From: Yihao Han @ 2022-06-10 7:45 UTC (permalink / raw)
To: Felipe Balbi, Greg Kroah-Hartman, linux-usb, linux-kernel; +Cc: Yihao Han
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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] usb: phy: tahvo: Check before clk_disable() not needed
2022-06-10 7:45 [PATCH] usb: phy: tahvo: Check before clk_disable() not needed Yihao Han
@ 2022-06-10 9:01 ` Greg Kroah-Hartman
0 siblings, 0 replies; 2+ messages in thread
From: Greg Kroah-Hartman @ 2022-06-10 9:01 UTC (permalink / raw)
To: Yihao Han; +Cc: Felipe Balbi, linux-usb, linux-kernel
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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-06-10 9:01 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-10 7:45 [PATCH] usb: phy: tahvo: Check before clk_disable() not needed Yihao Han
2022-06-10 9:01 ` Greg Kroah-Hartman
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.