diff mbox

[v2,04/12] FSP/LED: Validate before creating led node

Message ID 20150406083035.24643.98358.stgit@localhost.localdomain
State Accepted
Headers show

Commit Message

Vasant Hegde April 6, 2015, 8:30 a.m. UTC
We get SAI indicator via HDAT. So we have to create led node
while parsing HDAT itself. Lets get led node from device tree.

Note that LED DT creation fails until next commit...which creates
LED device tree node.

Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
---
 hw/fsp/fsp-leds.c |    7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
diff mbox

Patch

diff --git a/hw/fsp/fsp-leds.c b/hw/fsp/fsp-leds.c
index d25376d..a932016 100644
--- a/hw/fsp/fsp-leds.c
+++ b/hw/fsp/fsp-leds.c
@@ -1306,13 +1306,14 @@  void create_led_device_nodes(void)
 		return;
 	}
 
-	/* LED parent node */
-	pled = dt_new(opal_node, DT_PROPERTY_LED_NODE);
+	/* Get LED node */
+	pled = dt_find_by_path(opal_node, DT_PROPERTY_LED_NODE);
 	if (!pled) {
 		prlog(PR_WARNING, PREFIX
-		      "Parent device node creation failed\n");
+		      "Parent device node not available\n");
 		return;
 	}
+
 	dt_add_property_strings(pled, "compatible", DT_PROPERTY_LED_COMPATIBLE);
 
 	/* LED child nodes */