public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] regulator: core: Properly handle the case min_uV < rdev->desc->min_uV in map_voltage_linear
@ 2012-06-07  1:52 Axel Lin
  0 siblings, 0 replies; only message in thread
From: Axel Lin @ 2012-06-07  1:52 UTC (permalink / raw)
  To: linux-kernel; +Cc: Mark Brown, Liam Girdwood

Properly handle the case if the specified min_uV is less than the voltage given
by the lowest selector.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
---
 drivers/regulator/core.c |    3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
index 3cbe312..02c1940 100644
--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -2075,6 +2075,9 @@ int regulator_map_voltage_linear(struct regulator_dev *rdev,
 		return -EINVAL;
 	}
 
+	if (min_uV < rdev->desc->min_uV)
+		min_uV = rdev->desc->min_uV;
+
 	ret = DIV_ROUND_UP(min_uV - rdev->desc->min_uV, rdev->desc->uV_step);
 	if (ret < 0)
 		return ret;
-- 
1.7.9.5




^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2012-06-07  1:52 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-06-07  1:52 [PATCH] regulator: core: Properly handle the case min_uV < rdev->desc->min_uV in map_voltage_linear Axel Lin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox