]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/4.14.53/backlight-tps65217_bl-fix-device-tree-node-lookup.patch
5.1-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 4.14.53 / backlight-tps65217_bl-fix-device-tree-node-lookup.patch
CommitLineData
0f714131
GKH
1From 2b12dfa124dbadf391cb9a616aaa6b056823bf75 Mon Sep 17 00:00:00 2001
2From: Johan Hovold <johan@kernel.org>
3Date: Mon, 20 Nov 2017 11:45:46 +0100
4Subject: backlight: tps65217_bl: Fix Device Tree node lookup
5
6From: Johan Hovold <johan@kernel.org>
7
8commit 2b12dfa124dbadf391cb9a616aaa6b056823bf75 upstream.
9
10Fix child-node lookup during probe, which ended up searching the whole
11device tree depth-first starting at the parent rather than just matching
12on its children.
13
14This would only cause trouble if the child node is missing while there
15is an unrelated node named "backlight" elsewhere in the tree.
16
17Cc: stable <stable@vger.kernel.org> # 3.7
18Fixes: eebfdc17cc6c ("backlight: Add TPS65217 WLED driver")
19Signed-off-by: Johan Hovold <johan@kernel.org>
20Acked-by: Daniel Thompson <daniel.thompson@linaro.org>
21Signed-off-by: Lee Jones <lee.jones@linaro.org>
22Signed-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