projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
4d6144d
)
mmc: sh_mmcif: simplify clock divisor calculation
author
Guennadi Liakhovetski
<
[email protected]
>
Wed, 23 Nov 2011 14:52:30 +0000
(15:52 +0100)
committer
Chris Ball
<
[email protected]
>
Thu, 12 Jan 2012 04:58:42 +0000
(23:58 -0500)
Replace ilog2(__rounddown_pow_of_two(x)) with the equivalent but much
simpler fls(x) - 1.
Reported-by: Andrew Morton <
[email protected]
>
Signed-off-by: Guennadi Liakhovetski <
[email protected]
>
Signed-off-by: Chris Ball <
[email protected]
>
drivers/mmc/host/sh_mmcif.c
patch
|
blob
|
history
diff --git
a/drivers/mmc/host/sh_mmcif.c
b/drivers/mmc/host/sh_mmcif.c
index d5505f3fe2a170d04fc9011c5b5d2ff886a31df7..2ec23b0053b661d6de8ffd3d2e05eba325d9fb1e 100644
(file)
--- a/
drivers/mmc/host/sh_mmcif.c
+++ b/
drivers/mmc/host/sh_mmcif.c
@@
-16,6
+16,7
@@
*
*/
+#include <linux/bitops.h>
#include <linux/clk.h>
#include <linux/completion.h>
#include <linux/delay.h>
@@
-399,7
+400,7
@@
static void sh_mmcif_clock_control(struct sh_mmcif_host *host, unsigned int clk)
sh_mmcif_bitset(host, MMCIF_CE_CLK_CTRL, CLK_SUP_PCLK);
else
sh_mmcif_bitset(host, MMCIF_CE_CLK_CTRL, CLK_CLEAR &
-
(ilog2(__rounddown_pow_of_two(host->clk / clk)
) << 16));
+
((fls(host->clk / clk) - 1
) << 16));
sh_mmcif_bitset(host, MMCIF_CE_CLK_CTRL, CLK_ENABLE);
}