Skip to content

Commit a7d5fe0

Browse files
claudiubezneagregkh
authored andcommitted
usb: host: Do not check priv->clks[clk]
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>
1 parent 6637187 commit a7d5fe0

2 files changed

Lines changed: 2 additions & 4 deletions

File tree

drivers/usb/host/ehci-platform.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,7 @@ static void ehci_platform_power_off(struct platform_device *dev)
112112
int clk;
113113

114114
for (clk = EHCI_MAX_CLKS - 1; clk >= 0; clk--)
115-
if (priv->clks[clk])
116-
clk_disable_unprepare(priv->clks[clk]);
115+
clk_disable_unprepare(priv->clks[clk]);
117116
}
118117

119118
static struct hc_driver __read_mostly ehci_platform_hc_driver;

drivers/usb/host/ohci-platform.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,7 @@ static void ohci_platform_power_off(struct platform_device *dev)
6969
int clk;
7070

7171
for (clk = OHCI_MAX_CLKS - 1; clk >= 0; clk--)
72-
if (priv->clks[clk])
73-
clk_disable_unprepare(priv->clks[clk]);
72+
clk_disable_unprepare(priv->clks[clk]);
7473
}
7574

7675
static struct hc_driver __read_mostly ohci_platform_hc_driver;

0 commit comments

Comments
 (0)