Skip to content

Commit

Permalink
mmc: dw_mmc: remove the unnecessary IS_ERR() checking for ciu/biu clock
Browse files Browse the repository at this point in the history
If ciu/biu clock are NULL, clk_disable_unprepare should be just
returned. In clk_disable_unprepare(), already checked whether clk is
error or NULL.

Signed-off-by: Jaehoon Chung <[email protected]>
Reviewed-by: Shawn Lin <[email protected]>
Signed-off-by: Ulf Hansson <[email protected]>
  • Loading branch information
Jaehoon Chung authored and storulf committed Sep 26, 2016
1 parent 00f400b commit 7037f3b
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions drivers/mmc/host/dw_mmc.c
Original file line number Diff line number Diff line change
Expand Up @@ -3151,12 +3151,10 @@ int dw_mci_probe(struct dw_mci *host)
host->dma_ops->exit(host);

err_clk_ciu:
if (!IS_ERR(host->ciu_clk))
clk_disable_unprepare(host->ciu_clk);
clk_disable_unprepare(host->ciu_clk);

err_clk_biu:
if (!IS_ERR(host->biu_clk))
clk_disable_unprepare(host->biu_clk);
clk_disable_unprepare(host->biu_clk);

return ret;
}
Expand All @@ -3182,11 +3180,8 @@ void dw_mci_remove(struct dw_mci *host)
if (host->use_dma && host->dma_ops->exit)
host->dma_ops->exit(host);

if (!IS_ERR(host->ciu_clk))
clk_disable_unprepare(host->ciu_clk);

if (!IS_ERR(host->biu_clk))
clk_disable_unprepare(host->biu_clk);
clk_disable_unprepare(host->ciu_clk);
clk_disable_unprepare(host->biu_clk);
}
EXPORT_SYMBOL(dw_mci_remove);

Expand Down

0 comments on commit 7037f3b

Please sign in to comment.