mmc: sh_mmcif: Restructure ->set_ios()
authorUlf Hansson <ulf.hansson@linaro.org>
Thu, 11 Feb 2016 12:59:54 +0000 (13:59 +0100)
committerUlf Hansson <ulf.hansson@linaro.org>
Mon, 2 May 2016 08:33:08 +0000 (10:33 +0200)
commit4caf653a55210dfc1c024d88e5148148f64802ad
tree63608163b087549062da6a914e08bd25a6ed62fb
parent88ac2a2c30468bb9f750170d92f7dd1ab91ddcbb
mmc: sh_mmcif: Restructure ->set_ios()

Both from a runtime PM and clock management point of view, the ->set_ios()
code is unnecessary complex.

A suboptimal path is also executed when the mmc core requests a clock rate
of zero. As that happens during the card initialization phase, trying to
save power by decreasing the runtime PM usage count and gating the clock
via clk_disable_unprepare() is just superfluous.

Moreover, from a runtime PM point of view the core will anyway keep the
device active during the entire card initialization phase.

Restructure the code to rely on the ios->power_mode to understand when the
runtime PM usage count needs to be increased. Let's also deal with clock
rate changes by simply applying the rate.

Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
drivers/mmc/host/sh_mmcif.c