Skip to contentSkip to conversation

clk: rockchip: fix mmc get phase

PATCH In review Jerome Brunet 2 participants 2 messages Mar 3, 2020 – Mar 5, 2020

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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")

---
 drivers/clk/rockchip/clk-mmc-phase.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/clk/rockchip/clk-mmc-phase.c +2 -2
index 4abe7ff31f53..975454a3dd72 100644
@@ -51,9 +51,9 @@ static int rockchip_mmc_get_phase(struct clk_hw *hw)
 	u16 degrees;
 	u32 delay_num = 0;
 
-	/* See the comment for rockchip_mmc_set_phase below */
+	/* Constant signal, no measurable phase shift */
 	if (!rate)
-		return -EINVAL;
+		return 0;
 
 	raw_value = readl(mmc_clock->reg) >> (mmc_clock->shift);
 
Signature · 1 line
2.24.1
maintainer
#1 lore raw

Quoting Jerome Brunet (2020-03-03 11:29:56)

Quoted 9 lines

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")

---

Applied to clk-next right on top of the phase branch.