提交 22003000 编写于 作者: T Tomasz Figa 提交者: Chris Ball

mmc: sdhci-s3c: Do not allow frequencies higher than requested

This patch modifies sdhci_s3c_consider_clock() to fail if bus clock
being considered can not provide frequency lower or equal requested,
instead of returning the lowest supported.
Signed-off-by: NTomasz Figa <tomasz.figa@gmail.com>
Tested-by: NHeiko Stuebner <heiko@sntech.de>
Acked-by: NHeiko Stuebner <heiko@sntech.de>
Tested-by: NJaehoon Chung <jh80.chung@samsung.com>
Acked-by; Jaehoon Chung <jh80.chung@samsung.com>
Signed-off-by: NChris Ball <chris@printf.net>
上级 3ac147fa
......@@ -126,11 +126,18 @@ static unsigned int sdhci_s3c_consider_clock(struct sdhci_s3c *ourhost,
rate = ourhost->clk_rates[src];
for (shift = 0; shift < 8; ++shift) {
for (shift = 0; shift <= 8; ++shift) {
if ((rate >> shift) <= wanted)
break;
}
if (shift > 8) {
dev_dbg(&ourhost->pdev->dev,
"clk %d: rate %ld, min rate %lu > wanted %u\n",
src, rate, rate / 256, wanted);
return UINT_MAX;
}
dev_dbg(&ourhost->pdev->dev, "clk %d: rate %ld, want %d, got %ld\n",
src, rate, wanted, rate >> shift);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册