]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commit5167a7b6f38b5260bb2a4deb1ab351ec5071ed31
tree63608163b087549062da6a914e08bd25a6ed62fb
parent5a6d4e4de64fb7dc8b88e69c720024ffdea19607
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