diff options
author | Charles Keepax <ckeepax@opensource.wolfsonmicro.com> | 2015-02-20 11:08:43 -0500 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2015-02-21 09:30:02 -0500 |
commit | ec454d7016f2c9c897235b362089ddf9f1f8e4b8 (patch) | |
tree | 861e10abaf8405d57eb0dd4cf1855da872faf398 /drivers/regulator/arizona-ldo1.c | |
parent | bfa76d49576599a4b9f9b7a71f23d73d6dcff735 (diff) |
regulator: arizona-ldo1: Drop OF node reference on error path
We were not calling of_node_put if the regulator failed to register this
patch fixes this.
Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/regulator/arizona-ldo1.c')
-rw-r--r-- | drivers/regulator/arizona-ldo1.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/regulator/arizona-ldo1.c b/drivers/regulator/arizona-ldo1.c index 8169165904c0..a1d07d347c20 100644 --- a/drivers/regulator/arizona-ldo1.c +++ b/drivers/regulator/arizona-ldo1.c | |||
@@ -282,6 +282,9 @@ static int arizona_ldo1_probe(struct platform_device *pdev) | |||
282 | arizona->external_dcvdd = true; | 282 | arizona->external_dcvdd = true; |
283 | 283 | ||
284 | ldo1->regulator = devm_regulator_register(&pdev->dev, desc, &config); | 284 | ldo1->regulator = devm_regulator_register(&pdev->dev, desc, &config); |
285 | |||
286 | of_node_put(config.of_node); | ||
287 | |||
285 | if (IS_ERR(ldo1->regulator)) { | 288 | if (IS_ERR(ldo1->regulator)) { |
286 | ret = PTR_ERR(ldo1->regulator); | 289 | ret = PTR_ERR(ldo1->regulator); |
287 | dev_err(arizona->dev, "Failed to register LDO1 supply: %d\n", | 290 | dev_err(arizona->dev, "Failed to register LDO1 supply: %d\n", |
@@ -289,8 +292,6 @@ static int arizona_ldo1_probe(struct platform_device *pdev) | |||
289 | return ret; | 292 | return ret; |
290 | } | 293 | } |
291 | 294 | ||
292 | of_node_put(config.of_node); | ||
293 | |||
294 | platform_set_drvdata(pdev, ldo1); | 295 | platform_set_drvdata(pdev, ldo1); |
295 | 296 | ||
296 | return 0; | 297 | return 0; |