Skip to contentSkip to conversation

clk/tegra/clk-tegra124-dfll-fcpu: Add check to 'regulator_list_voltage'

PATCH In review Alfredo Cruz 2 participants 2 messages Mar 14, 2023 – Mar 15, 2023

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

PATCH 1/1 clk/tegra/clk-tegra124-dfll-fcpu: Add check to 'regulator_list_voltage'

---
Hi,
I'm not entirely sure if 'regulator_list_voltage(reg, 0)' will never return less than 0.

 drivers/clk/tegra/clk-tegra124-dfll-fcpu.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/clk/tegra/clk-tegra124-dfll-fcpu.c +2 -0
index 5e339ad0a97c..745bb828e53e 100644
@@ -543,6 +543,8 @@ static int get_alignment_from_regulator(struct device *dev,
 		return PTR_ERR(reg);
 
 	align->offset_uv = regulator_list_voltage(reg, 0);
+	if (align->offset_uv < 0)
+		align->offset_uv = 0;
 	align->step_uv = regulator_get_linear_step(reg);
 
 	regulator_put(reg);
Signature · 1 line
2.39.2
maintainer
#1 lore raw

Quoting Alfredo Cruz (2023-03-14 06:17:18)

Quoted 1 line

Sorry, we can't apply this. It needs commit text. Please see Documentation/process/submitting-patches.rst

Quoted 3 lines

---
Hi,
I'm not entirely sure if 'regulator_list_voltage(reg, 0)' will never return less than 0.

Please find out.