diff options
author | Julien Grall <julien.grall@linaro.org> | 2013-09-13 13:49:10 +0100 |
---|---|---|
committer | Ian Campbell <ian.campbell@citrix.com> | 2013-09-17 15:27:43 +0100 |
commit | 190ece328e74d04bcf1c1bed386a7d1cfe9b031e (patch) | |
tree | ab0ff4ca517f312c977b6876f6cfc4a19f6ab833 /xen/common | |
parent | dff2cc632483e3870984c501b99f17f0d0f5bbc5 (diff) | |
download | xen-190ece328e74d04bcf1c1bed386a7d1cfe9b031e.tar.gz xen-190ece328e74d04bcf1c1bed386a7d1cfe9b031e.tar.bz2 xen-190ece328e74d04bcf1c1bed386a7d1cfe9b031e.zip |
xen/dts: Don't add a fake property "name" in the device tree
On new Flat Device Tree version, the property "name" may not exist.
The property is never used in Xen code except to set the field "name" of
dt_device_node.
For convenience, remove the fake property. It will save space during the
creation of the dom0 FDT.
Signed-off-by: Julien Grall <julien.grall@linaro.org>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Diffstat (limited to 'xen/common')
-rw-r--r-- | xen/common/device_tree.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/xen/common/device_tree.c b/xen/common/device_tree.c index 2c2dc5227f..61134fe404 100644 --- a/xen/common/device_tree.c +++ b/xen/common/device_tree.c @@ -1563,8 +1563,17 @@ static unsigned long __init unflatten_dt_node(const void *fdt, pp->name = "name"; pp->length = sz; pp->value = pp + 1; + /* + * The device tree creation code assume that the property + * "name" is not a fake. + * To avoid a big divergence with Linux code, only remove + * property link. In this case we will lose a bit of memory + */ +#if 0 *prev_pp = pp; prev_pp = &pp->next; +#endif + np->name = pp->value; memcpy(pp->value, ps, sz - 1); ((char *)pp->value)[sz - 1] = 0; dt_dprintk("fixed up name for %s -> %s\n", pathp, @@ -1574,7 +1583,7 @@ static unsigned long __init unflatten_dt_node(const void *fdt, if ( allnextpp ) { *prev_pp = NULL; - np->name = dt_get_property(np, "name", NULL); + np->name = (np->name) ? : dt_get_property(np, "name", NULL); np->type = dt_get_property(np, "device_type", NULL); if ( !np->name ) |