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:17:53 +0000 (16:17 +0200)
commit573dda18a809cce3ae4dc94de614cc6fe74ce176
tree033da39ad1a23dad6963198072b3aabfcde67f6f
parent04adc8209a9a6518ce8ff545e9d97dbf6d3b8adf
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