lkml.org 
[lkml]   [2012]   [Jun]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Subject[PATCH] regulator: core: Properly handle the case min_uV < rdev->desc->min_uV in map_voltage_linear
From
Date
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




\
 
 \ /
  Last update: 2012-06-07 04:21    [W:1.085 / U:0.032 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site