lkml.org 
[lkml]   [2013]   [Sep]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH V3 04/14] regulator: da9210: use devm_regulator_register()
    Date
    Use devm_regulator_register() to make cleanup paths simpler,
    and remove unnecessary remove().

    Signed-off-by: Jingoo Han <jg1.han@samsung.com>
    ---
    drivers/regulator/da9210-regulator.c | 10 +---------
    1 file changed, 1 insertion(+), 9 deletions(-)

    diff --git a/drivers/regulator/da9210-regulator.c b/drivers/regulator/da9210-regulator.c
    index f0fe54b..82368a3 100644
    --- a/drivers/regulator/da9210-regulator.c
    +++ b/drivers/regulator/da9210-regulator.c
    @@ -152,7 +152,7 @@ static int da9210_i2c_probe(struct i2c_client *i2c,
    config.driver_data = chip;
    config.regmap = chip->regmap;

    - rdev = regulator_register(&da9210_reg, &config);
    + rdev = devm_regulator_register(&i2c->dev, &da9210_reg, &config);
    if (IS_ERR(rdev)) {
    dev_err(&i2c->dev, "Failed to register DA9210 regulator\n");
    return PTR_ERR(rdev);
    @@ -165,13 +165,6 @@ static int da9210_i2c_probe(struct i2c_client *i2c,
    return 0;
    }

    -static int da9210_i2c_remove(struct i2c_client *i2c)
    -{
    - struct da9210 *chip = i2c_get_clientdata(i2c);
    - regulator_unregister(chip->rdev);
    - return 0;
    -}
    -
    static const struct i2c_device_id da9210_i2c_id[] = {
    {"da9210", 0},
    {},
    @@ -185,7 +178,6 @@ static struct i2c_driver da9210_regulator_driver = {
    .owner = THIS_MODULE,
    },
    .probe = da9210_i2c_probe,
    - .remove = da9210_i2c_remove,
    .id_table = da9210_i2c_id,
    };

    --
    1.7.10.4



    \
     
     \ /
      Last update: 2013-09-26 10:01    [W:4.286 / U:0.180 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site