diff mbox

[U-Boot,1/3] fdt: Export fdtdec_get_number()

Message ID 1426852308-13556-1-git-send-email-thierry.reding@gmail.com
State Changes Requested
Delegated to: Simon Glass
Headers show

Commit Message

Thierry Reding March 20, 2015, 11:51 a.m. UTC
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>
---
 include/fdtdec.h | 8 ++++++++
 lib/fdtdec.c     | 2 +-
 2 files changed, 9 insertions(+), 1 deletion(-)

Comments

Simon Glass March 23, 2015, 11:16 p.m. UTC | #1
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 mbox

Patch

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;