summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorGabe Black <gabeblack@chromium.org>2011-09-21 14:42:01 -0700
committerGabe Black <gabeblack@chromium.org>2011-09-21 16:42:08 -0700
commit3506c2042856eda7dc5d7720f9e21d77eeab113f (patch)
tree038e60adb30d2dd36bbb544ef728787f29ba1866 /common
parentce5e1d1e03e126d6d5ee46cea9814cfaa44fa8ff (diff)
Add some missing endian conversions in fdt_support.c
Some functions in fdt_support.c use fdt_getprop to read 32 bit values out of the device tree, but then use them directly without doing any endian conversion. Because they check for a value that doesn't actually appear in practice, the functions continued to work even though they're incorrect. This change adds the missing conversions. BUG=None TEST=Built and booted on Alex and Stumpy Change-Id: I467f68ad1eda7ef25c23341952c87b1a0a135285 Signed-off-by: Gabe Black <gabeblack@google.com> Reviewed-on: http://gerrit.chromium.org/gerrit/8077 Reviewed-by: Stefan Reinauer <reinauer@google.com> Reviewed-by: Simon Glass <sjg@chromium.org> Commit-Ready: Gabe Black <gabeblack@chromium.org> Tested-by: Gabe Black <gabeblack@chromium.org>
Diffstat (limited to 'common')
-rw-r--r--common/fdt_support.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/common/fdt_support.c b/common/fdt_support.c
index 0795820c019..b7d7815128c 100644
--- a/common/fdt_support.c
+++ b/common/fdt_support.c
@@ -61,7 +61,7 @@ u32 fdt_getprop_u32_default(const void *fdt, const char *path,
val = fdt_getprop(fdt, off, prop, NULL);
if (val)
- return *val;
+ return fdt32_to_cpu(*val);
else
return dflt;
}
@@ -372,7 +372,7 @@ static int get_cells_len(void *blob, char *nr_cells_name)
const u32 *cell;
cell = fdt_getprop(blob, 0, nr_cells_name, NULL);
- if (cell && *cell == 2)
+ if (cell && fdt32_to_cpu(*cell) == 2)
return 8;
return 4;