regulator: arizona-micsupp: 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>
This commit is contained in:
Родитель
bfa76d4957
Коммит
a7b976ae4b
|
@ -284,6 +284,9 @@ static int arizona_micsupp_probe(struct platform_device *pdev)
|
||||||
micsupp->regulator = devm_regulator_register(&pdev->dev,
|
micsupp->regulator = devm_regulator_register(&pdev->dev,
|
||||||
desc,
|
desc,
|
||||||
&config);
|
&config);
|
||||||
|
|
||||||
|
of_node_put(config.of_node);
|
||||||
|
|
||||||
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",
|
||||||
|
@ -291,8 +294,6 @@ static int arizona_micsupp_probe(struct platform_device *pdev)
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
of_node_put(config.of_node);
|
|
||||||
|
|
||||||
platform_set_drvdata(pdev, micsupp);
|
platform_set_drvdata(pdev, micsupp);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Загрузка…
Ссылка в новой задаче