clk: rockchip: Prevent calculating mmc phase if clock rate is zero
authorShawn Lin <shawn.lin@rock-chips.com>
Mon, 5 Mar 2018 03:25:58 +0000 (11:25 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 25 May 2018 14:13:11 +0000 (16:13 +0200)
commit1325a6c91a880e3aacb7a0acc3dfba3840361653
treeae329629853edad5606a0c5009851fc4e47ef8ef
parente651dc5a400262cf0f9f52edaf381df2f8dfd634
clk: rockchip: Prevent calculating mmc phase if clock rate is zero

[ Upstream commit 4bf59902b50012b1dddeeaa23b217d9c4956cdda ]

The MMC sample and drv clock for rockchip platforms are derived from
the bus clock output to the MMC/SDIO card. So it should never happens
that the clk rate is zero given it should inherits the clock rate from
its parent. If something goes wrong and makes the clock rate to be zero,
the calculation would be wrong but may still make the mmc tuning process
work luckily. However it makes people harder to debug when the following
data transfer is unstable.

Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/clk/rockchip/clk-mmc-phase.c