[PATCH] regulator: core: Use map_voltage_linear() iflist_voltage_linear() is in use and nothing is set
From: Axel Lin
Date: Sun Jun 03 2012 - 21:42:31 EST
Signed-off-by: Axel Lin <axel.lin@xxxxxxxxx>
---
drivers/regulator/core.c | 14 ++++++++++----
1 file changed, 10 insertions(+), 4 deletions(-)
diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
index 8521e0d..3cbe312 100644
--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -2118,12 +2118,18 @@ static int _regulator_do_set_voltage(struct regulator_dev *rdev,
ret = rdev->desc->ops->set_voltage(rdev, min_uV, max_uV,
&selector);
} else if (rdev->desc->ops->set_voltage_sel) {
- if (rdev->desc->ops->map_voltage)
+ if (rdev->desc->ops->map_voltage) {
ret = rdev->desc->ops->map_voltage(rdev, min_uV,
max_uV);
- else
- ret = regulator_map_voltage_iterate(rdev, min_uV,
- max_uV);
+ } else {
+ if (rdev->desc->ops->list_voltage ==
+ regulator_list_voltage_linear)
+ ret = regulator_map_voltage_linear(rdev,
+ min_uV, max_uV);
+ else
+ ret = regulator_map_voltage_iterate(rdev,
+ min_uV, max_uV);
+ }
if (ret >= 0) {
selector = ret;
--
1.7.9.5
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/