]> git.baikalelectronics.ru Git - kernel.git/commit
mmc: mediatek: Fixed bug where clock frequency could be set wrong
authoryong mao <yong.mao@mediatek.com>
Sat, 4 Mar 2017 07:10:03 +0000 (15:10 +0800)
committerUlf Hansson <ulf.hansson@linaro.org>
Thu, 16 Mar 2017 12:24:38 +0000 (13:24 +0100)
commit67bc40e062de19092dd1bc0c97fa581e7e9143e7
treeebd0f88e7a15f7eadcb5721bdfedd946462a99b0
parent1980f5ab351d42df5795d4da737875274db48025
mmc: mediatek: Fixed bug where clock frequency could be set wrong

This patch can fix two issues:

Issue 1:
In previous code, div may be overflow when setting clock frequency
as f_min. We can use DIV_ROUND_UP to fix this boundary related
issue.

Issue 2:
In previous code, we can not set the correct clock frequency when
div equals 0xff.

Signed-off-by: Yong Mao <yong.mao@mediatek.com>
Signed-off-by: Chaotian Jing <chaotian.jing@mediatek.com>
Reviewed-by: Daniel Kurtz <djkurtz@chromium.org>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
drivers/mmc/host/mtk-sd.c