Skip to contentSkip to conversation

clk: tegra: fix error return case for recalc_rate

PATCH Applied Mikko Perttunen 2 participants 2 messages Sep 12, 2023

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

PATCH 1/1 clk: tegra: fix error return case for recalc_rate

From: Timo Alho <[email protected]>

tegra-bpmp clocks driver makes implicit conversion of signed error code to unsigned value in recalc_rate operation. The behavior for recalc_rate, according to it's specification, should be that "If the driver cannot figure out a rate for this clock, it must return 0."

Fixes ca6f2796eef7 ("clk: tegra: Add BPMP clock driver")
---
 drivers/clk/tegra/clk-bpmp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/clk/tegra/clk-bpmp.c +1 -1
index a9f3fb448de6..7bfba0afd778 100644
@@ -159,7 +159,7 @@ static unsigned long tegra_bpmp_clk_recalc_rate(struct clk_hw *hw,
 
 	err = tegra_bpmp_clk_transfer(clk->bpmp, &msg);
 	if (err < 0)
-		return err;
+		return 0;
 
 	return response.rate;
 }
Signature · 1 line
2.41.0
maintainer Applied
#1 lore raw

Quoting Mikko Perttunen (2023-09-12 04:29:50)

Quoted 11 lines

From: Timo Alho <[email protected]>

tegra-bpmp clocks driver makes implicit conversion of signed error code to unsigned value in recalc_rate operation. The behavior for recalc_rate, according to it's specification, should be that "If the driver cannot figure out a rate for this clock, it must return 0."

Fixes ca6f2796eef7 ("clk: tegra: Add BPMP clock driver")

---

Applied to clk-fixes