From: Thierry Reding Date: Fri, 20 Mar 2015 12:51:46 +0100 Subject: [U-Boot] [PATCH 1/3] fdt: Export fdtdec_get_number() Message-ID: <1426852308-13556-1-git-send-email-thierry.reding@gmail.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de From: Thierry Reding Drivers that need to parse addresses from the device tree will want to reuse this function rather than duplicating it. Cc: Simon Glass Signed-off-by: Thierry Reding --- include/fdtdec.h | 8 ++++++++ lib/fdtdec.c | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) 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; -- 2.3.2