regulator: tps6105x: Use regulator_list_voltage_table()
authorAxel Lin <axel.lin@gmail.com>
Sun, 20 May 2012 02:37:33 +0000 (10:37 +0800)
committerMark Brown <broonie@opensource.wolfsonmicro.com>
Sun, 3 Jun 2012 12:25:01 +0000 (13:25 +0100)
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
drivers/regulator/tps6105x-regulator.c

index d840d8440a91691b0954f5cb84fd134c1118f036..1378409efaec70170b8a3c70eeb09e1402abec33 100644 (file)
@@ -20,7 +20,7 @@
 #include <linux/mfd/core.h>
 #include <linux/mfd/tps6105x.h>
 
-static const int tps6105x_voltages[] = {
+static const unsigned int tps6105x_voltages[] = {
        4500000,
        5000000,
        5250000,
@@ -105,22 +105,13 @@ static int tps6105x_regulator_set_voltage_sel(struct regulator_dev *rdev,
        return 0;
 }
 
-static int tps6105x_regulator_list_voltage(struct regulator_dev *rdev,
-                                          unsigned selector)
-{
-       if (selector >= ARRAY_SIZE(tps6105x_voltages))
-               return -EINVAL;
-
-       return tps6105x_voltages[selector];
-}
-
 static struct regulator_ops tps6105x_regulator_ops = {
        .enable         = tps6105x_regulator_enable,
        .disable        = tps6105x_regulator_disable,
        .is_enabled     = tps6105x_regulator_is_enabled,
        .get_voltage_sel = tps6105x_regulator_get_voltage_sel,
        .set_voltage_sel = tps6105x_regulator_set_voltage_sel,
-       .list_voltage   = tps6105x_regulator_list_voltage,
+       .list_voltage   = regulator_list_voltage_table,
 };
 
 static const struct regulator_desc tps6105x_regulator_desc = {
@@ -130,6 +121,7 @@ static const struct regulator_desc tps6105x_regulator_desc = {
        .id             = 0,
        .owner          = THIS_MODULE,
        .n_voltages     = ARRAY_SIZE(tps6105x_voltages),
+       .volt_table     = tps6105x_voltages,
 };
 
 /*
This page took 0.027303 seconds and 5 git commands to generate.