regulator: of: regulator_of_get_init_data() missing of_node_get()

Boot fails for qcom-apq8074-dragonboard on 4.13-rc1 with error:
OF: ERROR: Bad of_node_put() on /soc/spmi@fc4cf000/pm8941@1/regulators

The error will occur if the configuration is set to:
   CONFIG_OF_OVERLAY y
   CONFIG_OF_UNITTEST y
   CONFIG_OF_DYNAMIC y
   CONFIG_OF_RESOLVE y

If CONFIG_OF_DYNAMIC is enabled then of_node_release() detects an
attempt to release a node that is still attached to the device tree.

Signed-off-by: Frank Rowand <frank.rowand@sony.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
Frank Rowand 2017-07-18 16:36:37 -07:00 committed by Mark Brown
parent 5771a8c088
commit 423a11647c
1 changed files with 1 additions and 1 deletions

View File

@ -333,7 +333,7 @@ struct regulator_init_data *regulator_of_get_init_data(struct device *dev,
search = of_get_child_by_name(dev->of_node, search = of_get_child_by_name(dev->of_node,
desc->regulators_node); desc->regulators_node);
else else
search = dev->of_node; search = of_node_get(dev->of_node);
if (!search) { if (!search) {
dev_dbg(dev, "Failed to find regulator container node '%s'\n", dev_dbg(dev, "Failed to find regulator container node '%s'\n",