aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/regulator/max8973-regulator.c
diff options
context:
space:
mode:
authorSachin Kamat <sachin.kamat@linaro.org>2013-09-04 01:38:00 -0400
committerMark Brown <broonie@linaro.org>2013-09-16 19:28:41 -0400
commit8d581fd01c922f9df586074078d70027156cfff8 (patch)
tree53ac29e38b7854d72cb904ee472cfc027ff1b334 /drivers/regulator/max8973-regulator.c
parent5ecdf140f21c50c08be34a83b44f28722813366c (diff)
regulator: max8973-regulator: 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>
Diffstat (limited to 'drivers/regulator/max8973-regulator.c')
-rw-r--r--drivers/regulator/max8973-regulator.c11
1 files changed, 1 insertions, 10 deletions
diff --git a/drivers/regulator/max8973-regulator.c b/drivers/regulator/max8973-regulator.c
index 5b77ab7762e4..892aa1e5b96c 100644
--- a/drivers/regulator/max8973-regulator.c
+++ b/drivers/regulator/max8973-regulator.c
@@ -467,7 +467,7 @@ static int max8973_probe(struct i2c_client *client,
467 config.regmap = max->regmap; 467 config.regmap = max->regmap;
468 468
469 /* Register the regulators */ 469 /* Register the regulators */
470 rdev = regulator_register(&max->desc, &config); 470 rdev = devm_regulator_register(&client->dev, &max->desc, &config);
471 if (IS_ERR(rdev)) { 471 if (IS_ERR(rdev)) {
472 ret = PTR_ERR(rdev); 472 ret = PTR_ERR(rdev);
473 dev_err(max->dev, "regulator register failed, err %d\n", ret); 473 dev_err(max->dev, "regulator register failed, err %d\n", ret);
@@ -478,14 +478,6 @@ static int max8973_probe(struct i2c_client *client,
478 return 0; 478 return 0;
479} 479}
480 480
481static int max8973_remove(struct i2c_client *client)
482{
483 struct max8973_chip *max = i2c_get_clientdata(client);
484
485 regulator_unregister(max->rdev);
486 return 0;
487}
488
489static const struct i2c_device_id max8973_id[] = { 481static const struct i2c_device_id max8973_id[] = {
490 {.name = "max8973",}, 482 {.name = "max8973",},
491 {}, 483 {},
@@ -499,7 +491,6 @@ static struct i2c_driver max8973_i2c_driver = {
499 .owner = THIS_MODULE, 491 .owner = THIS_MODULE,
500 }, 492 },
501 .probe = max8973_probe, 493 .probe = max8973_probe,
502 .remove = max8973_remove,
503 .id_table = max8973_id, 494 .id_table = max8973_id,
504}; 495};
505 496