Messages in this thread Patch in this message | | | From | Jingoo Han <> | Subject | [PATCH 14/20] regulator: max8952: use devm_regulator_register() | Date | Wed, 25 Sep 2013 17:08:13 +0900 |
| |
Use devm_regulator_register() to make cleanup paths simpler.
Signed-off-by: Jingoo Han <jg1.han@samsung.com> --- drivers/regulator/max8952.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/regulator/max8952.c b/drivers/regulator/max8952.c index 788e5ae..6fb7ec1 100644 --- a/drivers/regulator/max8952.c +++ b/drivers/regulator/max8952.c @@ -231,7 +231,8 @@ static int max8952_pmic_probe(struct i2c_client *client, if (pdata->reg_data->constraints.boot_on) config.ena_gpio_flags |= GPIOF_OUT_INIT_HIGH; - max8952->rdev = regulator_register(®ulator, &config); + max8952->rdev = devm_regulator_register(&client->dev, ®ulator, + &config); if (IS_ERR(max8952->rdev)) { ret = PTR_ERR(max8952->rdev); @@ -321,9 +322,6 @@ static int max8952_pmic_remove(struct i2c_client *client) { struct max8952_data *max8952 = i2c_get_clientdata(client); struct max8952_platform_data *pdata = max8952->pdata; - struct regulator_dev *rdev = max8952->rdev; - - regulator_unregister(rdev); gpio_free(pdata->gpio_vid0); gpio_free(pdata->gpio_vid1); -- 1.7.10.4
| |