[<prev] [next>] [day] [month] [year] [list]
Message-ID: <1339033932.7309.1.camel@phoenix>
Date: Thu, 07 Jun 2012 09:52:12 +0800
From: Axel Lin <axel.lin@...il.com>
To: linux-kernel@...r.kernel.org
Cc: Mark Brown <broonie@...nsource.wolfsonmicro.com>,
Liam Girdwood <lrg@...com>
Subject: [PATCH] regulator: core: Properly handle the case min_uV <
rdev->desc->min_uV in map_voltage_linear
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@...il.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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists