Skip to content

Commit e453f92

Browse files
Sachin Kamatbroonie
authored andcommitted
regulator: max8649: Use devm_regulator_register
devm_* simplifies the code. Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Signed-off-by: Mark Brown <broonie@linaro.org>
1 parent 027a275 commit e453f92

1 file changed

Lines changed: 2 additions & 12 deletions

File tree

‎drivers/regulator/max8649.c‎

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,8 @@ static int max8649_regulator_probe(struct i2c_client *client,
234234
config.driver_data = info;
235235
config.regmap = info->regmap;
236236

237-
info->regulator = regulator_register(&dcdc_desc, &config);
237+
info->regulator = devm_regulator_register(&client->dev, &dcdc_desc,
238+
&config);
238239
if (IS_ERR(info->regulator)) {
239240
dev_err(info->dev, "failed to register regulator %s\n",
240241
dcdc_desc.name);
@@ -244,16 +245,6 @@ static int max8649_regulator_probe(struct i2c_client *client,
244245
return 0;
245246
}
246247

247-
static int max8649_regulator_remove(struct i2c_client *client)
248-
{
249-
struct max8649_regulator_info *info = i2c_get_clientdata(client);
250-
251-
if (info)
252-
regulator_unregister(info->regulator);
253-
254-
return 0;
255-
}
256-
257248
static const struct i2c_device_id max8649_id[] = {
258249
{ "max8649", 0 },
259250
{ }
@@ -262,7 +253,6 @@ MODULE_DEVICE_TABLE(i2c, max8649_id);
262253

263254
static struct i2c_driver max8649_driver = {
264255
.probe = max8649_regulator_probe,
265-
.remove = max8649_regulator_remove,
266256
.driver = {
267257
.name = "max8649",
268258
},

0 commit comments

Comments
 (0)