aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/regulator/max8649.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/regulator/max8649.c')
-rw-r--r--drivers/regulator/max8649.c14
1 files changed, 2 insertions, 12 deletions
diff --git a/drivers/regulator/max8649.c b/drivers/regulator/max8649.c
index 19c6f08eafd5..7f049c92ee52 100644
--- a/drivers/regulator/max8649.c
+++ b/drivers/regulator/max8649.c
@@ -234,7 +234,8 @@ static int max8649_regulator_probe(struct i2c_client *client,
234 config.driver_data = info; 234 config.driver_data = info;
235 config.regmap = info->regmap; 235 config.regmap = info->regmap;
236 236
237 info->regulator = regulator_register(&dcdc_desc, &config); 237 info->regulator = devm_regulator_register(&client->dev, &dcdc_desc,
238 &config);
238 if (IS_ERR(info->regulator)) { 239 if (IS_ERR(info->regulator)) {
239 dev_err(info->dev, "failed to register regulator %s\n", 240 dev_err(info->dev, "failed to register regulator %s\n",
240 dcdc_desc.name); 241 dcdc_desc.name);
@@ -244,16 +245,6 @@ static int max8649_regulator_probe(struct i2c_client *client,
244 return 0; 245 return 0;
245} 246}
246 247
247static 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
257static const struct i2c_device_id max8649_id[] = { 248static const struct i2c_device_id max8649_id[] = {
258 { "max8649", 0 }, 249 { "max8649", 0 },
259 { } 250 { }
@@ -262,7 +253,6 @@ MODULE_DEVICE_TABLE(i2c, max8649_id);
262 253
263static struct i2c_driver max8649_driver = { 254static struct i2c_driver max8649_driver = {
264 .probe = max8649_regulator_probe, 255 .probe = max8649_regulator_probe,
265 .remove = max8649_regulator_remove,
266 .driver = { 256 .driver = {
267 .name = "max8649", 257 .name = "max8649",
268 }, 258 },