diff options
author | Mark Brown <broonie@linaro.org> | 2013-10-24 11:11:35 +0100 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2013-10-24 11:11:35 +0100 |
commit | b735e47f6e94f07911dcdf92837ebfd0ec1cf7c0 (patch) | |
tree | 12b9d1bf32084db43b7c1060c59410c194786dfb /drivers/regulator/da9063-regulator.c | |
parent | 3242a86170070a332037bff65ab5872189e20791 (diff) | |
parent | 5e0855759ca621bba454747fc1b5b76a7290f50f (diff) | |
download | linux-stable-b735e47f6e94f07911dcdf92837ebfd0ec1cf7c0.tar.gz linux-stable-b735e47f6e94f07911dcdf92837ebfd0ec1cf7c0.tar.bz2 linux-stable-b735e47f6e94f07911dcdf92837ebfd0ec1cf7c0.zip |
Merge remote-tracking branch 'regulator/topic/devm' into regulator-next
Diffstat (limited to 'drivers/regulator/da9063-regulator.c')
-rw-r--r-- | drivers/regulator/da9063-regulator.c | 21 |
1 files changed, 4 insertions, 17 deletions
diff --git a/drivers/regulator/da9063-regulator.c b/drivers/regulator/da9063-regulator.c index 3d910f4f3a0e..56727eb745df 100644 --- a/drivers/regulator/da9063-regulator.c +++ b/drivers/regulator/da9063-regulator.c @@ -847,13 +847,13 @@ static int da9063_regulator_probe(struct platform_device *pdev) if (da9063_reg_matches) config.of_node = da9063_reg_matches[id].of_node; config.regmap = da9063->regmap; - regl->rdev = regulator_register(®l->desc, &config); + regl->rdev = devm_regulator_register(&pdev->dev, ®l->desc, + &config); if (IS_ERR(regl->rdev)) { dev_err(&pdev->dev, "Failed to register %s regulator\n", regl->desc.name); - ret = PTR_ERR(regl->rdev); - goto err; + return PTR_ERR(regl->rdev); } id++; n++; @@ -862,9 +862,8 @@ static int da9063_regulator_probe(struct platform_device *pdev) /* LDOs overcurrent event support */ irq = platform_get_irq_byname(pdev, "LDO_LIM"); if (irq < 0) { - ret = irq; dev_err(&pdev->dev, "Failed to get IRQ.\n"); - goto err; + return irq; } regulators->irq_ldo_lim = regmap_irq_get_virq(da9063->regmap_irq, irq); @@ -881,27 +880,15 @@ static int da9063_regulator_probe(struct platform_device *pdev) } return 0; - -err: - /* Wind back regulators registeration */ - while (--n >= 0) - regulator_unregister(regulators->regulator[n].rdev); - - return ret; } static int da9063_regulator_remove(struct platform_device *pdev) { struct da9063_regulators *regulators = platform_get_drvdata(pdev); - struct da9063_regulator *regl; free_irq(regulators->irq_ldo_lim, regulators); free_irq(regulators->irq_uvov, regulators); - for (regl = ®ulators->regulator[regulators->n_regulators - 1]; - regl >= ®ulators->regulator[0]; regl--) - regulator_unregister(regl->rdev); - return 0; } |