summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArtem Shimko <a.shimko.dev@gmail.com>2026-05-22 10:31:31 +0300
committerUlf Hansson <ulfh@kernel.org>2026-05-29 15:48:35 +0300
commit423ab671bb921206bab25ffe61adc5da98a64e6c (patch)
treedcef977d735e2b63d8fa611e664ee3942aa2b2f8
parent906d715cae80593470926f9fe1105d7d4a1ce14b (diff)
downloadlinux-423ab671bb921206bab25ffe61adc5da98a64e6c.tar.xz
mmc: sdhci-of-dwcmshc: remove redundant IS_ERR() check
The clk_disable_unprepare() function has internal protection against ERR_PTR and NULL pointers (IS_ERR_OR_NULL). Remove the redundant IS_ERR() check for bus_clk in dwcmshc_suspend() and in the error path of dwcmshc_resume() to simplify the code. Note that the clk_prepare_enable() call in dwcmshc_resume() must retain its IS_ERR() check because clk_prepare() only handles NULL pointers, not ERR_PTR. No functional change intended. Acked-by: Adrian Hunter <adrian.hunter@intel.com> Signed-off-by: Artem Shimko <a.shimko.dev@gmail.com> Signed-off-by: Ulf Hansson <ulfh@kernel.org>
-rw-r--r--drivers/mmc/host/sdhci-of-dwcmshc.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/mmc/host/sdhci-of-dwcmshc.c b/drivers/mmc/host/sdhci-of-dwcmshc.c
index b9ecd91f44ad..0786304e7a2f 100644
--- a/drivers/mmc/host/sdhci-of-dwcmshc.c
+++ b/drivers/mmc/host/sdhci-of-dwcmshc.c
@@ -2564,8 +2564,7 @@ static int dwcmshc_suspend(struct device *dev)
return ret;
clk_disable_unprepare(pltfm_host->clk);
- if (!IS_ERR(priv->bus_clk))
- clk_disable_unprepare(priv->bus_clk);
+ clk_disable_unprepare(priv->bus_clk);
clk_bulk_disable_unprepare(priv->num_other_clks, priv->other_clks);
@@ -2608,8 +2607,7 @@ static int dwcmshc_resume(struct device *dev)
disable_other_clks:
clk_bulk_disable_unprepare(priv->num_other_clks, priv->other_clks);
disable_bus_clk:
- if (!IS_ERR(priv->bus_clk))
- clk_disable_unprepare(priv->bus_clk);
+ clk_disable_unprepare(priv->bus_clk);
disable_clk:
clk_disable_unprepare(pltfm_host->clk);
return ret;