[PATCH 05/11] regulator: Add missing cases in regulator_map_voltage()

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

 



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

Signed-off-by: Sascha Hauer <s.hauer@xxxxxxxxxxxxxx>
---
 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





[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux