Commit 08df4a21c7d580770cabd7ba62591da035d9a545

Authored by Arnab Basu
Committed by York Sun
1 parent bb5783224b

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 <arnab.basu@freescale.com>
Cc: Scott Wood <scottwood@freescale.com>

Showing 2 changed files with 9 additions and 9 deletions Side-by-side Diff

common/fdt_support.c
... ... @@ -930,15 +930,6 @@
930 930 fdt_delprop(blob, off, alias);
931 931 }
932 932  
933   -/* Helper to read a big number; size is in cells (not bytes) */
934   -static inline u64 of_read_number(const fdt32_t *cell, int size)
935   -{
936   - u64 r = 0;
937   - while (size--)
938   - r = (r << 32) | fdt32_to_cpu(*(cell++));
939   - return r;
940   -}
941   -
942 933 #define PRu64 "%llx"
943 934  
944 935 /* Max address size we deal with */
include/fdt_support.h
... ... @@ -133,6 +133,15 @@
133 133 return fdt_set_status_by_alias(fdt, alias, FDT_STATUS_FAIL, 0);
134 134 }
135 135  
  136 +/* Helper to read a big number; size is in cells (not bytes) */
  137 +static inline u64 of_read_number(const fdt32_t *cell, int size)
  138 +{
  139 + u64 r = 0;
  140 + while (size--)
  141 + r = (r << 32) | fdt32_to_cpu(*(cell++));
  142 + return r;
  143 +}
  144 +
136 145 #endif /* ifdef CONFIG_OF_LIBFDT */
137 146  
138 147 #ifdef USE_HOSTCC