From: Arnab Basu Date: Mon, 8 Sep 2014 19:19:58 +0000 (-0700) Subject: fdt_support: Move of_read_number to fdt_support.h X-Git-Url: http://git.dujemihanovic.xyz/?a=commitdiff_plain;h=08df4a21c7d580770cabd7ba62591da035d9a545;p=u-boot.git fdt_support: Move of_read_number to fdt_support.h This is being done so that it can be used outside 'fdt_support.c'. Making life more convenient when reading device node properties that can be 32 or 64 bits long. Signed-off-by: Arnab Basu Cc: Scott Wood --- diff --git a/common/fdt_support.c b/common/fdt_support.c index 784a570a81..7ec7d4fc59 100644 --- a/common/fdt_support.c +++ b/common/fdt_support.c @@ -930,15 +930,6 @@ void fdt_del_node_and_alias(void *blob, const char *alias) fdt_delprop(blob, off, alias); } -/* Helper to read a big number; size is in cells (not bytes) */ -static inline u64 of_read_number(const fdt32_t *cell, int size) -{ - u64 r = 0; - while (size--) - r = (r << 32) | fdt32_to_cpu(*(cell++)); - return r; -} - #define PRu64 "%llx" /* Max address size we deal with */ diff --git a/include/fdt_support.h b/include/fdt_support.h index 1bda686a0b..649fbd6cc5 100644 --- a/include/fdt_support.h +++ b/include/fdt_support.h @@ -133,6 +133,15 @@ static inline int fdt_status_fail_by_alias(void *fdt, const char *alias) return fdt_set_status_by_alias(fdt, alias, FDT_STATUS_FAIL, 0); } +/* Helper to read a big number; size is in cells (not bytes) */ +static inline u64 of_read_number(const fdt32_t *cell, int size) +{ + u64 r = 0; + while (size--) + r = (r << 32) | fdt32_to_cpu(*(cell++)); + return r; +} + #endif /* ifdef CONFIG_OF_LIBFDT */ #ifdef USE_HOSTCC