From 8b2f6c4c4a006708e6434cb1950344f068a369b4 Mon Sep 17 00:00:00 2001 From: Myles Watson Date: Wed, 15 Oct 2008 17:46:52 +0000 Subject: [PATCH] Change statictree emit function to emit path correctly for cpus. Signed-off-by: Myles Watson Acked-by: Ronald G. Minnich git-svn-id: svn://coreboot.org/repository/coreboot-v3@931 f3766cd6-281f-0410-b1cd-43a5c92072e9 --- util/dtc/flattree.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/util/dtc/flattree.c b/util/dtc/flattree.c index e0383e1a53..bc51229ea3 100644 --- a/util/dtc/flattree.c +++ b/util/dtc/flattree.c @@ -572,14 +572,15 @@ static void coreboot_emit_special(FILE *e, struct node *tree) fprintf(f, "\t.path = { .type = DEVICE_PATH_ROOT },\n"); } + /* special case -- cpus don't have an @ */ + if (tree->name && !strncmp(tree->name, "cpus", 4)){ + fprintf(f, "\t.path = {.type=DEVICE_PATH_CPU},\n"); + } + /* from the node names (tree->name) we derive the path */ path = index(tree->name, '@'); if (path && path[1]) { path++; - if (!strncmp(tree->name, "cpu", 3)){ - fprintf(f, "\t.path = {.type=DEVICE_PATH_CPU,{.cpu={ .id = 0x%s }}},\n", - path); - } if (!strncmp(tree->name, "bus", 3)){ fprintf(f, "\t.path = {.type=DEVICE_PATH_PCI_BUS,{.pci_bus={ .bus = 0x%s }}},\n", path);