Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

clk: rockchip: fix mmc get phase

If the mmc clock has no rate, it can be assumed to be constant.
In such case, there is no measurable phase shift. Just return 0
in this case instead of returning an error.

Fixes: 2760878662a2 ("clk: Bail out when calculating phase fails during clk registration")
Tested-by: Markus Reichl <m.reichl@fivetechno.de>
Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
Link: https://lkml.kernel.org/r/20200303192956.64410-1-jbrunet@baylibre.com
Signed-off-by: Stephen Boyd <sboyd@kernel.org>

authored by

Jerome Brunet and committed by
Stephen Boyd
d8949925 c3944ec8

+2 -2
+2 -2
drivers/clk/rockchip/clk-mmc-phase.c
··· 51 51 u16 degrees; 52 52 u32 delay_num = 0; 53 53 54 - /* See the comment for rockchip_mmc_set_phase below */ 54 + /* Constant signal, no measurable phase shift */ 55 55 if (!rate) 56 - return -EINVAL; 56 + return 0; 57 57 58 58 raw_value = readl(mmc_clock->reg) >> (mmc_clock->shift); 59 59