leds: 88pm860x: Use of_get_child_by_name
authorKrzysztof Kozlowski <k.kozlowski@samsung.com>
Fri, 4 Apr 2014 07:51:19 +0000 (00:51 -0700)
committerBryan Wu <cooloney@gmail.com>
Thu, 8 May 2014 06:28:08 +0000 (14:28 +0800)
Use of_get_child_by_name to obtain reference to charger node instead of
of_find_node_by_name which can walk outside of the parent node.

Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Signed-off-by: Bryan Wu <cooloney@gmail.com>
drivers/leds/leds-88pm860x.c

index d1e1bca..c3d58e6 100644 (file)
@@ -133,7 +133,7 @@ static int pm860x_led_dt_init(struct platform_device *pdev,
        nproot = of_node_get(pdev->dev.parent->of_node);
        if (!nproot)
                return -ENODEV;
-       nproot = of_find_node_by_name(nproot, "leds");
+       nproot = of_get_child_by_name(nproot, "leds");
        if (!nproot) {
                dev_err(&pdev->dev, "failed to find leds node\n");
                return -ENODEV;