regulator_map_voltage() misses to handle some cases, sync this with the
kernel.

Signed-off-by: Sascha Hauer <[email protected]>
---
 drivers/regulator/core.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
index 5693fa9634..b9a97a784f 100644
--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -33,7 +33,10 @@ static int regulator_map_voltage(struct regulator_dev *rdev, 
int min_uV,
        if (rdev->desc->ops->list_voltage == regulator_list_voltage_linear)
                return regulator_map_voltage_linear(rdev, min_uV, max_uV);
 
-       return -ENOSYS;
+       if (rdev->desc->ops->list_voltage == 
regulator_list_voltage_linear_range)
+               return regulator_map_voltage_linear_range(rdev, min_uV, max_uV);
+
+       return regulator_map_voltage_iterate(rdev, min_uV, max_uV);
 }
 
 static int regulator_enable_internal(struct regulator_dev *rdev)
-- 
2.39.2


Reply via email to