From: Axel Lin Date: Sat, 24 May 2014 03:10:43 +0000 (+0800) Subject: regulator: core: Use map_voltage_linear_range by default for list_voltage_linear_range X-Git-Tag: v3.16-rc1~30^2~28^2~5^2~1 X-Git-Url: http://git.samba.org/samba.git/?a=commitdiff_plain;h=366986274c548261c42d5ca24391cb4eef3008c2;p=sfrench%2Fcifs-2.6.git 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. Signed-off-by: Axel Lin Signed-off-by: Mark Brown --- diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c index ba28d29b66d2..476661117930 100644 --- a/drivers/regulator/core.c +++ b/drivers/regulator/core.c @@ -2322,6 +2322,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);