Message ID | 1426852308-13556-1-git-send-email-thierry.reding@gmail.com |
---|---|
State | Changes Requested |
Delegated to: | Simon Glass |
Headers | show |
Hi Thierry, On 20 March 2015 at 05:51, Thierry Reding <thierry.reding@gmail.com> wrote: > From: Thierry Reding <treding@nvidia.com> > > Drivers that need to parse addresses from the device tree will want to > reuse this function rather than duplicating it. > > Cc: Simon Glass <sjg@chromium.org> > Signed-off-by: Thierry Reding <treding@nvidia.com> Please see this patch: http://patchwork.ozlabs.org/patch/446862/ Regards, Simon
diff --git a/include/fdtdec.h b/include/fdtdec.h index 5ac515d87d2d..5530ee407311 100644 --- a/include/fdtdec.h +++ b/include/fdtdec.h @@ -723,6 +723,14 @@ int fdtdec_read_fmap_entry(const void *blob, int node, const char *name, struct fmap_entry *entry); /** + * Read a number from a device property. + * @param ptr pointer to the cells to read + * @param cells number of cells to consume + * @return The number contained in @cells cells at @ptr, in host byte order. + */ +u64 fdtdec_get_number(const fdt32_t *ptr, unsigned int cells); + +/** * Obtain an indexed resource from a device property. * * @param fdt FDT blob diff --git a/lib/fdtdec.c b/lib/fdtdec.c index 0776c3004cbd..613cc8494a74 100644 --- a/lib/fdtdec.c +++ b/lib/fdtdec.c @@ -918,7 +918,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;