2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2024-12-21 11:44:01 +08:00

regulator: arizona-micsupp: Convert to devm_regulator_register()

Signed-off-by: Mark Brown <broonie@linaro.org>
This commit is contained in:
Mark Brown 2013-08-31 11:57:00 +01:00
parent 14ffa8882b
commit b6b7709cf9

View File

@ -225,7 +225,9 @@ static int arizona_micsupp_probe(struct platform_device *pdev)
regmap_update_bits(arizona->regmap, ARIZONA_MIC_CHARGE_PUMP_1, regmap_update_bits(arizona->regmap, ARIZONA_MIC_CHARGE_PUMP_1,
ARIZONA_CPMIC_BYPASS, 0); ARIZONA_CPMIC_BYPASS, 0);
micsupp->regulator = regulator_register(&arizona_micsupp, &config); micsupp->regulator = devm_regulator_register(&pdev->dev,
&arizona_micsupp,
&config);
if (IS_ERR(micsupp->regulator)) { if (IS_ERR(micsupp->regulator)) {
ret = PTR_ERR(micsupp->regulator); ret = PTR_ERR(micsupp->regulator);
dev_err(arizona->dev, "Failed to register mic supply: %d\n", dev_err(arizona->dev, "Failed to register mic supply: %d\n",
@ -238,18 +240,8 @@ static int arizona_micsupp_probe(struct platform_device *pdev)
return 0; return 0;
} }
static int arizona_micsupp_remove(struct platform_device *pdev)
{
struct arizona_micsupp *micsupp = platform_get_drvdata(pdev);
regulator_unregister(micsupp->regulator);
return 0;
}
static struct platform_driver arizona_micsupp_driver = { static struct platform_driver arizona_micsupp_driver = {
.probe = arizona_micsupp_probe, .probe = arizona_micsupp_probe,
.remove = arizona_micsupp_remove,
.driver = { .driver = {
.name = "arizona-micsupp", .name = "arizona-micsupp",
.owner = THIS_MODULE, .owner = THIS_MODULE,