Commit eba9473f authored by Charles Keepax's avatar Charles Keepax Committed by Mark Brown

regulator: Allow regulator nodes to contain their own init data

Currently it is expected that regulator init data will be defined as a
series of sub-nodes from the node that bound in the driver. Add support
for a node to both bind in a driver and contain init data for that
regulator.
Signed-off-by: default avatarCharles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 925c85e2
...@@ -380,12 +380,16 @@ struct device_node *regulator_of_get_init_node(struct device *dev, ...@@ -380,12 +380,16 @@ struct device_node *regulator_of_get_init_node(struct device *dev,
if (!dev->of_node || !desc->of_match) if (!dev->of_node || !desc->of_match)
return NULL; return NULL;
if (desc->regulators_node) if (desc->regulators_node) {
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 = of_node_get(dev->of_node); search = of_node_get(dev->of_node);
if (!strcmp(desc->of_match, search->name))
return search;
}
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",
desc->regulators_node); desc->regulators_node);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment