]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
usb: host: Do not check priv->clks[clk]
authorClaudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
Thu, 6 Nov 2025 14:36:22 +0000 (16:36 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 21 Nov 2025 14:11:22 +0000 (15:11 +0100)
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 <claudiu.beznea.uj@bp.renesas.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://patch.msgid.link/20251106143625.3050119-2-claudiu.beznea.uj@bp.renesas.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/host/ehci-platform.c
drivers/usb/host/ohci-platform.c

index bcd1c9073515156687acabbd563a261633eabe97..57d5a7ddac5f0133bdd206f95a7e15468cba8a17 100644 (file)
@@ -112,8 +112,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;
index f47ae12cde6a26c0796da36cb2156861250c561d..af26f1449bc2e8097fffdc6b53b6551dde3fa331 100644 (file)
@@ -69,8 +69,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;