aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGavin Shan <gwshan@linux.vnet.ibm.com>2015-11-12 13:33:12 +1100
committerStewart Smith <stewart@linux.vnet.ibm.com>2016-03-31 19:54:19 +1100
commit7c4fa604d9a6a94365abb6a8078b93caafed2dcf (patch)
treeddcf7fd447f0f3027d2b9d11d4db621cb3639f4e
parent2ebc0ae0a2c61c006062ba42fc253296060c34cf (diff)
downloadskiboot-7c4fa604d9a6a94365abb6a8078b93caafed2dcf.zip
skiboot-7c4fa604d9a6a94365abb6a8078b93caafed2dcf.tar.gz
skiboot-7c4fa604d9a6a94365abb6a8078b93caafed2dcf.tar.bz2
core/fdt: Adjust parameter for dt_{property, begin_node}
This passes property and device node as parameter to dt_property() and dt_begin_node separately so that we don't have to pass the individual fields of those two structs to the functions. No logical changes introduced. Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
-rw-r--r--core/fdt.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/core/fdt.c b/core/fdt.c
index 7abebba..a301f1f 100644
--- a/core/fdt.c
+++ b/core/fdt.c
@@ -49,21 +49,21 @@ static void dt_property_cell(const char *name, u32 cell)
save_err(fdt_property_cell(fdt, name, cell));
}
-static void dt_begin_node(const char *name, uint32_t phandle)
+static void dt_begin_node(const struct dt_node *dn)
{
- save_err(fdt_begin_node(fdt, name));
+ save_err(fdt_begin_node(fdt, dn->name));
/*
* We add both the new style "phandle" and the legacy
* "linux,phandle" properties
*/
- dt_property_cell("linux,phandle", phandle);
- dt_property_cell("phandle", phandle);
+ dt_property_cell("linux,phandle", dn->phandle);
+ dt_property_cell("phandle", dn->phandle);
}
-static void dt_property(const char *name, const void *val, size_t size)
+static void dt_property(const struct dt_property *p)
{
- save_err(fdt_property(fdt, name, val, size));
+ save_err(fdt_property(fdt, p->name, p->prop, p->len));
}
static void dt_end_node(void)
@@ -128,11 +128,11 @@ static void flatten_dt_node(const struct dt_node *root)
#ifdef DEBUG_FDT
printf("FDT: prop: %s size: %ld\n", p->name, p->len);
#endif
- dt_property(p->name, p->prop, p->len);
+ dt_property(p);
}
list_for_each(&root->children, i, list) {
- dt_begin_node(i->name, i->phandle);
+ dt_begin_node(i);
flatten_dt_node(i);
dt_end_node();
}
@@ -181,7 +181,7 @@ void *create_dtb(const struct dt_node *root)
create_dtb_reservemap(root);
/* Open root node */
- dt_begin_node(root->name, root->phandle);
+ dt_begin_node(root);
/* Unflatten our live tree */
flatten_dt_node(root);