mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-11 23:50:25 +00:00
regulator: da9055: 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
ea49a5ebbb
commit
0d3288063b
@ -564,13 +564,13 @@ static int da9055_regulator_probe(struct platform_device *pdev)
|
|||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
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);
|
||||||
ret = PTR_ERR(regulator->rdev);
|
return PTR_ERR(regulator->rdev);
|
||||||
return ret;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Only LDO 5 and 6 has got the over current interrupt */
|
/* Only LDO 5 and 6 has got the over current interrupt */
|
||||||
@ -588,32 +588,18 @@ static int da9055_regulator_probe(struct platform_device *pdev)
|
|||||||
dev_err(&pdev->dev,
|
dev_err(&pdev->dev,
|
||||||
"Failed to request Regulator IRQ %d: %d\n",
|
"Failed to request Regulator IRQ %d: %d\n",
|
||||||
irq, ret);
|
irq, ret);
|
||||||
goto err_regulator;
|
return ret;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
platform_set_drvdata(pdev, regulator);
|
platform_set_drvdata(pdev, regulator);
|
||||||
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
err_regulator:
|
|
||||||
regulator_unregister(regulator->rdev);
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int da9055_regulator_remove(struct platform_device *pdev)
|
|
||||||
{
|
|
||||||
struct da9055_regulator *regulator = platform_get_drvdata(pdev);
|
|
||||||
|
|
||||||
regulator_unregister(regulator->rdev);
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct platform_driver da9055_regulator_driver = {
|
static struct platform_driver da9055_regulator_driver = {
|
||||||
.probe = da9055_regulator_probe,
|
.probe = da9055_regulator_probe,
|
||||||
.remove = da9055_regulator_remove,
|
|
||||||
.driver = {
|
.driver = {
|
||||||
.name = "da9055-regulator",
|
.name = "da9055-regulator",
|
||||||
.owner = THIS_MODULE,
|
.owner = THIS_MODULE,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user