summaryrefslogtreecommitdiffstats
path: root/drivers/regulator/max77686.c
diff options
context:
space:
mode:
authorMark Brown <broonie@linaro.org>2013-10-24 12:11:32 +0200
committerMark Brown <broonie@linaro.org>2013-10-24 12:11:32 +0200
commit420118d48311e0c4ef4aace5aede35079ecc2412 (patch)
treea4affbc11b9271d786b9c9e5711b1e7dc873d3e8 /drivers/regulator/max77686.c
parentMerge remote-tracking branch 'regulator/fix/ti-abb' into regulator-linus (diff)
parentmfd: arizona: Specify supply mappings for Arizona CODECs (diff)
downloadlinux-420118d48311e0c4ef4aace5aede35079ecc2412.tar.xz
linux-420118d48311e0c4ef4aace5aede35079ecc2412.zip
Merge remote-tracking branch 'regulator/topic/alias' into regulator-next
Diffstat (limited to 'drivers/regulator/max77686.c')
-rw-r--r--drivers/regulator/max77686.c23
1 files changed, 3 insertions, 20 deletions
diff --git a/drivers/regulator/max77686.c b/drivers/regulator/max77686.c
index f563057e5690..ae001ccf26f4 100644
--- a/drivers/regulator/max77686.c
+++ b/drivers/regulator/max77686.c
@@ -478,32 +478,16 @@ static int max77686_pmic_probe(struct platform_device *pdev)
config.of_node = pdata->regulators[i].of_node;
max77686->opmode[i] = regulators[i].enable_mask;
- max77686->rdev[i] = regulator_register(&regulators[i], &config);
+ max77686->rdev[i] = devm_regulator_register(&pdev->dev,
+ &regulators[i], &config);
if (IS_ERR(max77686->rdev[i])) {
- ret = PTR_ERR(max77686->rdev[i]);
dev_err(&pdev->dev,
"regulator init failed for %d\n", i);
- max77686->rdev[i] = NULL;
- goto err;
+ return PTR_ERR(max77686->rdev[i]);
}
}
return 0;
-err:
- while (--i >= 0)
- regulator_unregister(max77686->rdev[i]);
- return ret;
-}
-
-static int max77686_pmic_remove(struct platform_device *pdev)
-{
- struct max77686_data *max77686 = platform_get_drvdata(pdev);
- int i;
-
- for (i = 0; i < MAX77686_REGULATORS; i++)
- regulator_unregister(max77686->rdev[i]);
-
- return 0;
}
static const struct platform_device_id max77686_pmic_id[] = {
@@ -518,7 +502,6 @@ static struct platform_driver max77686_pmic_driver = {
.owner = THIS_MODULE,
},
.probe = max77686_pmic_probe,
- .remove = max77686_pmic_remove,
.id_table = max77686_pmic_id,
};