/
0006-tps65217-bl-Locate-backlight-node-correctly.patch
51 lines (41 loc) · 1.65 KB
/
0006-tps65217-bl-Locate-backlight-node-correctly.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
From 50df9ac6f1e696ce1abf7c19380659b530422c38 Mon Sep 17 00:00:00 2001
From: Pantelis Antoniou <panto@antoniou-consulting.com>
Date: Fri, 28 Dec 2012 16:54:51 +0200
Subject: [PATCH 006/184] tps65217-bl: Locate backlight node correctly.
When using overlays find_node doesn't work like it used to, because
the new nodes are inserted at the head of allnodes.
Use the correct function to locate the child node.
Signed-off-by: Pantelis Antoniou <panto@antoniou-consulting.com>
---
drivers/video/backlight/tps65217_bl.c | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/drivers/video/backlight/tps65217_bl.c b/drivers/video/backlight/tps65217_bl.c
index 69c1dfe..31a9203 100644
--- a/drivers/video/backlight/tps65217_bl.c
+++ b/drivers/video/backlight/tps65217_bl.c
@@ -247,12 +247,14 @@ tps65217_bl_parse_dt(struct platform_device *pdev, struct tps65217 **tpsp,
rnode = of_node_get(tps->dev->of_node);
- node = of_find_node_by_name(rnode, "backlight");
+ node = of_get_child_by_name(rnode, "backlight");
of_node_put(rnode);
rnode = NULL;
- if (!node)
+ if (!node) {
+ dev_err(&pdev->dev, "failed to find backlight node\n");
return ERR_PTR(-ENODEV);
+ }
pdata = devm_kzalloc(&pdev->dev, sizeof(*pdata), GFP_KERNEL);
if (!pdata) {
@@ -339,8 +341,10 @@ static int tps65217_bl_probe(struct platform_device *pdev)
if (pdev->dev.of_node) {
pdata = tps65217_bl_parse_dt(pdev, &tps, &brightness);
- if (IS_ERR(pdata))
+ if (IS_ERR(pdata)) {
+ dev_err(&pdev->dev, "DT parse failed.\n");
return PTR_ERR(pdata);
+ }
} else {
if (!pdev->dev.platform_data) {
dev_err(&pdev->dev, "no platform data provided\n");
--
1.8.2.1