]>
Commit | Line | Data |
---|---|---|
0f714131 GKH |
1 | From 2b12dfa124dbadf391cb9a616aaa6b056823bf75 Mon Sep 17 00:00:00 2001 |
2 | From: Johan Hovold <johan@kernel.org> | |
3 | Date: Mon, 20 Nov 2017 11:45:46 +0100 | |
4 | Subject: backlight: tps65217_bl: Fix Device Tree node lookup | |
5 | ||
6 | From: Johan Hovold <johan@kernel.org> | |
7 | ||
8 | commit 2b12dfa124dbadf391cb9a616aaa6b056823bf75 upstream. | |
9 | ||
10 | Fix child-node lookup during probe, which ended up searching the whole | |
11 | device tree depth-first starting at the parent rather than just matching | |
12 | on its children. | |
13 | ||
14 | This would only cause trouble if the child node is missing while there | |
15 | is an unrelated node named "backlight" elsewhere in the tree. | |
16 | ||
17 | Cc: stable <stable@vger.kernel.org> # 3.7 | |
18 | Fixes: eebfdc17cc6c ("backlight: Add TPS65217 WLED driver") | |
19 | Signed-off-by: Johan Hovold <johan@kernel.org> | |
20 | Acked-by: Daniel Thompson <daniel.thompson@linaro.org> | |
21 | Signed-off-by: Lee Jones <lee.jones@linaro.org> | |
22 | Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> | |
23 | ||
24 | --- | |
25 | drivers/video/backlight/tps65217_bl.c | 4 ++-- | |
26 | 1 file changed, 2 insertions(+), 2 deletions(-) | |
27 | ||
28 | --- a/drivers/video/backlight/tps65217_bl.c | |
29 | +++ b/drivers/video/backlight/tps65217_bl.c | |
30 | @@ -184,11 +184,11 @@ static struct tps65217_bl_pdata * | |
31 | tps65217_bl_parse_dt(struct platform_device *pdev) | |
32 | { | |
33 | struct tps65217 *tps = dev_get_drvdata(pdev->dev.parent); | |
34 | - struct device_node *node = of_node_get(tps->dev->of_node); | |
35 | + struct device_node *node; | |
36 | struct tps65217_bl_pdata *pdata, *err; | |
37 | u32 val; | |
38 | ||
39 | - node = of_find_node_by_name(node, "backlight"); | |
40 | + node = of_get_child_by_name(tps->dev->of_node, "backlight"); | |
41 | if (!node) | |
42 | return ERR_PTR(-ENODEV); | |
43 |