summaryrefslogtreecommitdiff
path: root/livetree.c
diff options
context:
space:
mode:
authorDavid Gibson <david@gibson.dropbear.id.au>2008-06-25 14:27:53 +1000
committerJon Loeliger <jdl@jdl.com>2008-07-14 12:07:22 -0500
commitc8c374b8565081da08e3d1d73df8ddb0d6a66ae3 (patch)
tree9cedc7a1cebed065c1af55f74733fa8b76ee8602 /livetree.c
parent53359016caf6db9ab2347517a323d6ba8eb6671e (diff)
downloaddevice-tree-compiler-c8c374b8565081da08e3d1d73df8ddb0d6a66ae3.tar.gz
dtc: Use the same endian-conversion functions as libfdt
Currently both libfdt and dtc define a set of endian conversion macros for accessing the device tree blob which is always big-endian. libfdt uses names like cpu_to_fdt32() and dtc uses names like cpu_to_be32 (as the Linux kernel). This patch switches dtc over to using the libfdt macros (including libfdt_env.h to supply them). This has a couple of small advantages: - Removes some code duplication - Will make conversion a bit easier if we ever need to produce little-endian device tree blobs. - dtc no longer needs to pull in netinet/in.h simply for the ntohs() and ntohl() functions Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Diffstat (limited to 'livetree.c')
-rw-r--r--livetree.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/livetree.c b/livetree.c
index 51680ae..ba7e263 100644
--- a/livetree.c
+++ b/livetree.c
@@ -204,7 +204,7 @@ struct property *get_property(struct node *node, const char *propname)
cell_t propval_cell(struct property *prop)
{
assert(prop->val.len == sizeof(cell_t));
- return be32_to_cpu(*((cell_t *)prop->val.val));
+ return fdt32_to_cpu(*((cell_t *)prop->val.val));
}
struct node *get_subnode(struct node *node, const char *nodename)