regulator: palmas: get regulators node from parent node only
authorLaxman Dewangan <ldewangan@nvidia.com>
Thu, 3 Oct 2013 14:06:37 +0000 (19:36 +0530)
committerMark Brown <broonie@linaro.org>
Mon, 7 Oct 2013 11:13:37 +0000 (12:13 +0100)
The device tree binding of Palmas regulator driver says as:

palmas_pmis {
compatible = "ti,palmas-pmic";
...
regulators {
...
}
};

In this "regulators" subnode is expected to be part of parent node, not
the outside of parent node. Hence to get the regulator node, the correct
call is of_get_child_by_name() rather than of_find_node_by_name() which
actually searches the "regulators" node from the parent node to end of DTS
file.

Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
drivers/regulator/palmas-regulator.c

index 1b31e414fde126847d7e5f0a859644d0f395a540..d68f05b105b58d3c31cbd55ed60227de20bcbf08 100644 (file)
@@ -826,7 +826,7 @@ static void palmas_dt_to_pdata(struct device *dev,
        int idx, ret;
 
        node = of_node_get(node);
-       regulators = of_find_node_by_name(node, "regulators");
+       regulators = of_get_child_by_name(node, "regulators");
        if (!regulators) {
                dev_info(dev, "regulator node not found\n");
                return;