mirror of
https://github.com/FEX-Emu/linux.git
synced 2025-01-16 22:51:32 +00:00
regulator: da9052: Convert to devm_regulator_register
Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Mark Brown <broonie@linaro.org>
This commit is contained in:
parent
4e8d79355d
commit
ea49a5ebbb
@ -389,8 +389,9 @@ static int da9052_regulator_probe(struct platform_device *pdev)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
regulator->rdev = regulator_register(®ulator->info->reg_desc,
|
regulator->rdev = devm_regulator_register(&pdev->dev,
|
||||||
&config);
|
®ulator->info->reg_desc,
|
||||||
|
&config);
|
||||||
if (IS_ERR(regulator->rdev)) {
|
if (IS_ERR(regulator->rdev)) {
|
||||||
dev_err(&pdev->dev, "failed to register regulator %s\n",
|
dev_err(&pdev->dev, "failed to register regulator %s\n",
|
||||||
regulator->info->reg_desc.name);
|
regulator->info->reg_desc.name);
|
||||||
@ -402,17 +403,8 @@ static int da9052_regulator_probe(struct platform_device *pdev)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int da9052_regulator_remove(struct platform_device *pdev)
|
|
||||||
{
|
|
||||||
struct da9052_regulator *regulator = platform_get_drvdata(pdev);
|
|
||||||
|
|
||||||
regulator_unregister(regulator->rdev);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static struct platform_driver da9052_regulator_driver = {
|
static struct platform_driver da9052_regulator_driver = {
|
||||||
.probe = da9052_regulator_probe,
|
.probe = da9052_regulator_probe,
|
||||||
.remove = da9052_regulator_remove,
|
|
||||||
.driver = {
|
.driver = {
|
||||||
.name = "da9052-regulator",
|
.name = "da9052-regulator",
|
||||||
.owner = THIS_MODULE,
|
.owner = THIS_MODULE,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user