mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-06 10:57:46 +00:00
regulator: pcf50633: use devm_regulator_register()
Use devm_regulator_register() to make cleanup paths simpler, and remove unnecessary remove(). Signed-off-by: Jingoo Han <jg1.han@samsung.com> Signed-off-by: Mark Brown <broonie@linaro.org>
This commit is contained in:
parent
15dc006af8
commit
5e0165e5a9
1 changed files with 2 additions and 11 deletions
|
@ -90,7 +90,8 @@ static int pcf50633_regulator_probe(struct platform_device *pdev)
|
||||||
config.driver_data = pcf;
|
config.driver_data = pcf;
|
||||||
config.regmap = pcf->regmap;
|
config.regmap = pcf->regmap;
|
||||||
|
|
||||||
rdev = regulator_register(®ulators[pdev->id], &config);
|
rdev = devm_regulator_register(&pdev->dev, ®ulators[pdev->id],
|
||||||
|
&config);
|
||||||
if (IS_ERR(rdev))
|
if (IS_ERR(rdev))
|
||||||
return PTR_ERR(rdev);
|
return PTR_ERR(rdev);
|
||||||
|
|
||||||
|
@ -102,21 +103,11 @@ static int pcf50633_regulator_probe(struct platform_device *pdev)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int pcf50633_regulator_remove(struct platform_device *pdev)
|
|
||||||
{
|
|
||||||
struct regulator_dev *rdev = platform_get_drvdata(pdev);
|
|
||||||
|
|
||||||
regulator_unregister(rdev);
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static struct platform_driver pcf50633_regulator_driver = {
|
static struct platform_driver pcf50633_regulator_driver = {
|
||||||
.driver = {
|
.driver = {
|
||||||
.name = "pcf50633-regltr",
|
.name = "pcf50633-regltr",
|
||||||
},
|
},
|
||||||
.probe = pcf50633_regulator_probe,
|
.probe = pcf50633_regulator_probe,
|
||||||
.remove = pcf50633_regulator_remove,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
static int __init pcf50633_regulator_init(void)
|
static int __init pcf50633_regulator_init(void)
|
||||||
|
|
Loading…
Reference in a new issue