Skip to content

Commit

Permalink
mmc: host: tmio: disable clocks when unbinding
Browse files Browse the repository at this point in the history
Create a helper function to disable clocks and use it in remove(), too.
Now, clk_summary in debugfs reports the clocks as disabled and
unprepared after unbinding.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
  • Loading branch information
Wolfram Sang authored and Ulf Hansson committed Feb 13, 2017
1 parent 44bf231 commit dfcba5f
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions drivers/mmc/host/tmio_mmc_pio.c
Original file line number Diff line number Diff line change
Expand Up @@ -900,6 +900,12 @@ static int tmio_mmc_clk_enable(struct tmio_mmc_host *host)
return host->clk_enable(host);
}

static void tmio_mmc_clk_disable(struct tmio_mmc_host *host)
{
if (host->clk_disable)
host->clk_disable(host);
}

static void tmio_mmc_power_on(struct tmio_mmc_host *host, unsigned short vdd)
{
struct mmc_host *mmc = host->mmc;
Expand Down Expand Up @@ -1284,6 +1290,8 @@ void tmio_mmc_host_remove(struct tmio_mmc_host *host)

pm_runtime_put_sync(&pdev->dev);
pm_runtime_disable(&pdev->dev);

tmio_mmc_clk_disable(host);
}
EXPORT_SYMBOL(tmio_mmc_host_remove);

Expand All @@ -1298,8 +1306,7 @@ int tmio_mmc_host_runtime_suspend(struct device *dev)
if (host->clk_cache)
tmio_mmc_clk_stop(host);

if (host->clk_disable)
host->clk_disable(host);
tmio_mmc_clk_disable(host);

return 0;
}
Expand Down

0 comments on commit dfcba5f

Please sign in to comment.