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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Alfredo Cruz <alfredo.carlon@xxxxxxxxx>
---
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(+)

diff --git a/drivers/clk/tegra/clk-tegra124-dfll-fcpu.c b/drivers/clk/tegra/clk-tegra124-dfll-fcpu.c
index 5e339ad0a97c..745bb828e53e 100644
--- a/drivers/clk/tegra/clk-tegra124-dfll-fcpu.c
+++ b/drivers/clk/tegra/clk-tegra124-dfll-fcpu.c
@@ -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);
-- 
2.39.2




[Index of Archives]     [ARM Kernel]     [Linux ARM]     [Linux ARM MSM]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux