[Skiboot] [PATCH] hdata: assert if we fail to add xscom nodes

Vasant Hegde hegdevasant at linux.vnet.ibm.com
Sat Nov 28 00:14:49 AEDT 2020

If we have duplicate xscom nodes then it will fail to attach xscom
node to device tree and we will fail eventully. Better to call assert()
and fail here.

Signed-off-by: Vasant Hegde <hegdevasant at linux.vnet.ibm.com>
 hdata/spira.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/hdata/spira.c b/hdata/spira.c
index deb2dea44..2e3b3a463 100644
--- a/hdata/spira.c
+++ b/hdata/spira.c
@@ -315,8 +315,7 @@ static struct dt_node *add_xscom_node(uint64_t base, uint32_t hw_id,
 	       hw_id, proc_chip_id, (long long)addr);
 	node = dt_new_addr(dt_root, "xscom", addr);
-	if (!node)
-		return NULL;
+	assert(node);
 	dt_add_property_cells(node, "ibm,chip-id", hw_id);
 	dt_add_property_cells(node, "ibm,proc-chip-id", proc_chip_id);

More information about the Skiboot mailing list