mmc: tmio: refactor CLK_CTL bit calculation
authorMasahiro Yamada <yamada.masahiro@socionext.com>
Thu, 23 Aug 2018 04:44:20 +0000 (13:44 +0900)
committerUlf Hansson <ulf.hansson@linaro.org>
Mon, 8 Oct 2018 09:40:43 +0000 (11:40 +0200)
commitdb4cea918e11d1cd1cb870049b2af17fe99d7b94
treed67c3b45621792fcd0a7e3c8a8680d49867d4f73
parent68f83127fe750c8b270361f4353cc9d76b0286d6
mmc: tmio: refactor CLK_CTL bit calculation

for (clk = 0x80000080; new_clock >= (clock << 1); clk >>= 1)
          clock <<= 1;

... is too tricky, hence I replaced with

  roundup_pow_of_two(divisor) >> 2

'(clk >> 22) & 0x1' is the bit test for the 1/1 divisor, but
it is not clear.  'divisor <= 1' is easier to understand.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Tested-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
drivers/mmc/host/tmio_mmc.c