Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

backlight: 88pm860x_bl: Use of_get_child_by_name() instead of refcount hack

of_find_node_by_name() calls of_node_put() on its "from" parameter.
To counter this, pm860x_backlight_dt_init() calls of_node_get() first.

Use of_get_child_by_name() instead to get rid of the refcount hack.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Lee Jones <lee.jones@linaro.org>

authored by

Geert Uytterhoeven and committed by
Lee Jones
c6f77bc2 9eccca08

+1 -4
+1 -4
drivers/video/backlight/88pm860x_bl.c
··· 168 168 struct device_node *nproot, *np; 169 169 int iset = 0; 170 170 171 - nproot = of_node_get(pdev->dev.parent->of_node); 172 - if (!nproot) 173 - return -ENODEV; 174 - nproot = of_find_node_by_name(nproot, "backlights"); 171 + nproot = of_get_child_by_name(pdev->dev.parent->of_node, "backlights"); 175 172 if (!nproot) { 176 173 dev_err(&pdev->dev, "failed to find backlights node\n"); 177 174 return -ENODEV;