lkml.org 
[lkml]   [2012]   [May]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Subject[PATCH RFC/RFT 6/7] regulator: tps6105x: Use regulator_list_voltage_table()
    From
    Date
    Signed-off-by: Axel Lin <axel.lin@gmail.com>
    ---
    drivers/regulator/tps6105x-regulator.c | 14 +++-----------
    1 files changed, 3 insertions(+), 11 deletions(-)

    diff --git a/drivers/regulator/tps6105x-regulator.c b/drivers/regulator/tps6105x-regulator.c
    index d840d84..1378409 100644
    --- a/drivers/regulator/tps6105x-regulator.c
    +++ b/drivers/regulator/tps6105x-regulator.c
    @@ -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,
    };

    /*
    --
    1.7.5.4




    \
     
     \ /
      Last update: 2012-05-20 05:01    [W:0.033 / U:62.188 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site