diff mbox

[U-Boot,v2,02/22] fdt: Export fdtdec_get_number() for general use

Message ID 1425583534-2238-3-git-send-email-sjg@chromium.org
State Accepted
Delegated to: Simon Glass
Headers show

Commit Message

Simon Glass March 5, 2015, 7:25 p.m. UTC
This function is missing a prototype but is more widey useful. Add it.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

Changes in v2: None

 include/fdtdec.h | 11 +++++++++++
 lib/fdtdec.c     |  2 +-
 2 files changed, 12 insertions(+), 1 deletion(-)

Comments

Tom Rini March 6, 2015, 3:43 p.m. UTC | #1
On Thu, Mar 05, 2015 at 12:25:14PM -0700, Simon Glass wrote:

> This function is missing a prototype but is more widey useful. Add it.
> 
> Signed-off-by: Simon Glass <sjg@chromium.org>

Reviewed-by: Tom Rini <trini@konsulko.com>
Simon Glass March 20, 2015, 11:14 p.m. UTC | #2
On 6 March 2015 at 08:43, Tom Rini <trini@konsulko.com> wrote:
> On Thu, Mar 05, 2015 at 12:25:14PM -0700, Simon Glass wrote:
>
>> This function is missing a prototype but is more widey useful. Add it.
>>
>> Signed-off-by: Simon Glass <sjg@chromium.org>
>
> Reviewed-by: Tom Rini <trini@konsulko.com>

Applied to u-boot-dm/next.
diff mbox

Patch

diff --git a/include/fdtdec.h b/include/fdtdec.h
index 1233dfb..21bd6bb 100644
--- a/include/fdtdec.h
+++ b/include/fdtdec.h
@@ -386,6 +386,17 @@  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
  * concatenated to form a 8 bytes value, where the first cell is top half and
diff --git a/lib/fdtdec.c b/lib/fdtdec.c
index 21933e4..e47fa96 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;