Skip to contentSkip to conversation

regulator: twl: Convert fixed voltage to use regulator_list_voltage_linear

PATCH In review Axel Lin 2 participants 2 messages Feb 16, 2013 – Mar 1, 2013

Subsystems (2)
lore
Share & tools
lore

Axel Lin

author
#0 lore raw

PATCH 1/1 regulator: twl: Convert fixed voltage to use regulator_list_voltage_linear

---
 drivers/regulator/twl-regulator.c |   12 +++---------
 1 file changed, 3 insertions(+), 9 deletions(-)
drivers/regulator/twl-regulator.c +3 -9
index d62604c0..2b3dc5b 100644
@@ -612,15 +612,8 @@ static struct regulator_ops twl6030ldo_ops = {
 /*
  * Fixed voltage LDOs don't have a VSEL field to update.
  */
-static int twlfixed_list_voltage(struct regulator_dev *rdev, unsigned index)
-{
-	struct twlreg_info	*info = rdev_get_drvdata(rdev);
-
-	return info->min_mV * 1000;
-}
-
 static struct regulator_ops twl4030fixed_ops = {
-	.list_voltage	= twlfixed_list_voltage,
+	.list_voltage	= regulator_list_voltage_linear,
 
 	.enable		= twl4030reg_enable,
 	.disable	= twl4030reg_disable,
@@ -632,7 +625,7 @@ static struct regulator_ops twl4030fixed_ops = {
 };
 
 static struct regulator_ops twl6030fixed_ops = {
-	.list_voltage	= twlfixed_list_voltage,
+	.list_voltage	= regulator_list_voltage_linear,
 
 	.enable		= twl6030reg_enable,
 	.disable	= twl6030reg_disable,
@@ -935,6 +928,7 @@ static const struct twlreg_info TWLFIXED_INFO_##label = { \
 		.name = #label, \
 		.id = family##_REG_##label, \
 		.n_voltages = 1, \
+		.min_uV = mVolts * 1000, \
 		.ops = &operations, \
 		.type = REGULATOR_VOLTAGE, \
 		.owner = THIS_MODULE, \
Signature · 1 line
1.7.9.5
#1 lore raw
Quoted 1 line · Axel Lin

I didn't apply this as there was an earlier version sitting in my tree which for some reason had never been pushed out and merged. Sorry about that.