[u-boot] fdt: Export fdtdec_get_number() for general use

This function is missing a prototype but is more widey useful. Add it.

Signed-off-by: Firefly <service@t-firefly.com>
Reviewed-by: Firefly <service@t-firefly.com>
This commit is contained in:
Firefly
2015-03-05 12:25:14 -07:00
committed by djw
parent 1fbe07ca9c
commit f06e19b746
2 changed files with 12 additions and 1 deletions

View File

@ -271,6 +271,17 @@ uint32_t fdtdec_get_reg(const void *blob, int node);
s32 fdtdec_get_int(const void *blob, int node, const char *prop_name,
s32 default_val);
/**
* Get a variable-sized number from a property
*
* This reads a number from one or more cells.
*
* @param ptr Pointer to property
* @param cells Number of cells containing the number
* @return the value in the cells
*/
u64 fdtdec_get_number(const fdt32_t *ptr, unsigned int cells);
/**
* Look up a 64-bit integer property in a node and return it. The property
* must have at least 8 bytes of data (2 cells). The first two cells are

View File

@ -834,7 +834,7 @@ int fdtdec_read_fmap_entry(const void *blob, int node, const char *name,
return 0;
}
static u64 fdtdec_get_number(const fdt32_t *ptr, unsigned int cells)
u64 fdtdec_get_number(const fdt32_t *ptr, unsigned int cells)
{
u64 number = 0;