Skip to contentSkip to conversation

regulator: core: Use map_voltage_linear_range by default for list_voltage_linear_range

PATCH Applied Axel Lin 2 participants 2 messages May 24, 2014 – May 26, 2014 Voltage and current regulator framework

lore
Share & tools
lore

Axel Lin

author
#0 lore raw

PATCH 1/1 regulator: core: Use map_voltage_linear_range by default for list_voltage_linear_range

Use map_voltage_linear_range() if list_voltage_linear_range() is in use and nothing is set.

---
 drivers/regulator/core.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/regulator/core.c +4 -0
index b97ffd2..7399cbf 100644
@@ -2321,6 +2321,10 @@ static int _regulator_do_set_voltage(struct regulator_dev *rdev,
 			    regulator_list_voltage_linear)
 				ret = regulator_map_voltage_linear(rdev,
 								min_uV, max_uV);
+			else if (rdev->desc->ops->list_voltage ==
+				 regulator_list_voltage_linear_range)
+				ret = regulator_map_voltage_linear_range(rdev,
+								min_uV, max_uV);
 			else
 				ret = regulator_map_voltage_iterate(rdev,
 								min_uV, max_uV);
Signature · 1 line
1.8.3.2
maintainer Applied
#1 lore raw
Quoted 2 lines · Axel Lin

Use map_voltage_linear_range() if list_voltage_linear_range() is in use and nothing is set.

Applied, thanks.