[PATCH 5.10.y-cip v2 12/27] usb: host: Do not check priv->clks[clk]
Claudiu Beznea <[email protected]> Wed, 8 Jul 2026 11:10:31 +0300
| Newsgroups | org.cip-project.lists.cip-dev |
|---|---|
| Message-ID | <[email protected]> |
From: Claudiu Beznea <[email protected]> commit a7d5fe02059af66c9759cbf9199e7ed381cc592a upstream. There is no need to check the entries in priv->clks[] array before passing it to clk_disable_unprepare() as the clk_disable_unprepare() already check if it receives a NULL or error pointer as argument. Remove this check. This makes the code simpler. Signed-off-by: Claudiu Beznea <[email protected]> Acked-by: Alan Stern <[email protected]> Reviewed-by: Geert Uytterhoeven <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]> Signed-off-by: Claudiu Beznea <[email protected]> --- Changes in v2: - none drivers/usb/host/ehci-platform.c | 3 +-- drivers/usb/host/ohci-platform.c | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/usb/host/ehci-platform.c b/drivers/usb/host/ehci-platform.c index 2dcfc67f2ba8..9140f6aade89 100644 --- a/drivers/usb/host/ehci-platform.c +++ b/drivers/usb/host/ehci-platform.c @@ -114,8 +114,7 @@ static void ehci_platform_power_off(struct platform_device *dev) int clk; for (clk = EHCI_MAX_CLKS - 1; clk >= 0; clk--) - if (priv->clks[clk]) - clk_disable_unprepare(priv->clks[clk]); + clk_disable_unprepare(priv->clks[clk]); } static struct hc_driver __read_mostly ehci_platform_hc_driver; diff --git a/drivers/usb/host/ohci-platform.c b/drivers/usb/host/ohci-platform.c index 365021e608d5..d8242a681ff3 100644 --- a/drivers/usb/host/ohci-platform.c +++ b/drivers/usb/host/ohci-platform.c @@ -70,8 +70,7 @@ static void ohci_platform_power_off(struct platform_device *dev) int clk; for (clk = OHCI_MAX_CLKS - 1; clk >= 0; clk--) - if (priv->clks[clk]) - clk_disable_unprepare(priv->clks[clk]); + clk_disable_unprepare(priv->clks[clk]); } static struct hc_driver __read_mostly ohci_platform_hc_driver; -- 2.43.0