lib, fdt: Adding fdtdec_get_u32 function
A message that is not in the archive (sent off-list or not yet received): [email protected]
PATCH v4 5/5 lib, fdt: Adding fdtdec_get_u32 function
PATCH v4 5/5 lib, fdt: Adding fdtdec_get_u32 function
Quoted 7 lines · Chin Liang See
From
3b86e60182b87a96f2e5e2236df7a877c9a8c468Mon Sep 17 00:00:00 2001
From: Chin Liang See <[email protected]>
Date: Thu, 15 Oct 2015 14:04:39 +0800
Subject: [PATCH v4 5/5] lib, fdt: Addingfdtdec_get_u32functionAdding
fdtdec_get_u32function which is the unsigned version forfdtdec_get_int
But the function you added is named fdtdec_get_uint() , not fdtdec_get_u32() ;-)
Quoted 72 lines
Signed-off-by Chin Liang See <[email protected]>Cc Dinh Nguyen <[email protected]>Cc Dinh Nguyen <[email protected]>Cc Marek Vasut <[email protected]>Cc Stefan Roese <[email protected]>Cc Vikas Manocha <[email protected]>Cc Jagannadh Teki <[email protected]>Cc Pavel Machek <[email protected]>Cc Heiko Schocher <[email protected]>---
Changes for v4
- Drop idea on enablingfdt_supportin SPL build--- include/fdtdec.h | 13 +++++++++++++ lib/fdtdec_common.c | 18 ++++++++++++++++++ 2 files changed, 31 insertions(+)include/fdtdec.h +7
-0@@ -490,6 +490,19 @@ s32 fdtdec_get_int(const void *blob, int node,const char *prop_name, s32 default_val);/** +* Unsigned version of fdtdec_get_int. The property must have at least +* 4 bytes of data. The value of the first cell is returned. +* +* @param blob FDT blob +* @param node node to examine +* @param prop_name name of property to find +* @param default_val default value to return if the property is not found
+ * @return unsigned integer value, if found, ordefault_valif not
+ */
+unsigned int fdtdec_get_uint(const void *blob, int node, const char*prop_name,include/fdtdec.h +3
-0+ unsigned int default_val); + +/** * Get a variable-sized number from a property * * This reads a number from one or more cells. lib/fdtdec_common.c +2
-0@@ -36,3 +36,21 @@ int fdtdec_get_int(const void *blob, int node, const char *prop_name, debug("(not found)\n");return default_val; } + +unsigned int fdtdec_get_uint(const void *blob, int node, const char
*prop_name,lib/fdtdec_common.c +16
-0+ unsigned int default_val) +{ +const int *cell; +int len; + +debug ("%s: %s: " , __func__, prop_name); + cell =fdt_getprop (blob, node, prop_name, &len); +if (cell && len >=sizeof (unsigned int )) { +unsigned int val =fdt32_to_cpu (cell[0 ]); + +debug ("%#x (%d)\n" , val, val); +return val; + } +debug ("(not found)\n" ); +return default_val; +}
PATCH v4 5/5 lib, fdt: Adding fdtdec_get_u32 function
Hi Marek,
Quoted 10 lines · marex at denx.de
Quoted 7 lines · Chin Liang See
From
3b86e60182b87a96f2e5e2236df7a877c9a8c468Mon Sep 17 00:00:00 2001
From: Chin Liang See <[email protected]>
Date: Thu, 15 Oct 2015 14:04:39 +0800
Subject: [PATCH v4 5/5] lib, fdt: Addingfdtdec_get_u32functionAdding
fdtdec_get_u32function which is the unsigned version forfdtdec_get_intBut the function you added is named
fdtdec_get_uint(), notfdtdec_get_u32();-)
Good catch, miss out this.
Will fix this.
Thanks
Chin Liang
Quoted 73 lines
Quoted 73 lines
Signed-off-by Chin Liang See <[email protected]>Cc Dinh Nguyen <[email protected]>Cc Dinh Nguyen <[email protected]>Cc Marek Vasut <[email protected]>Cc Stefan Roese <[email protected]>Cc Vikas Manocha <[email protected]>Cc Jagannadh Teki <[email protected]>Cc Pavel Machek <[email protected]>Cc Heiko Schocher <[email protected]>---
Changes for v4
- Drop idea on enablingfdt_supportin SPL build--- include/fdtdec.h | 13 +++++++++++++ lib/fdtdec_common.c | 18 ++++++++++++++++++ 2 files changed, 31 insertions(+)include/fdtdec.h +7
-0@@ -490,6 +490,19 @@ s32 fdtdec_get_int(const void *blob, int node,const char *prop_name, s32 default_val);/** +* Unsigned version of fdtdec_get_int. The property must have at least +* 4 bytes of data. The value of the first cell is returned. +* +* @param blob FDT blob +* @param node node to examine +* @param prop_name name of property to find +* @param default_val default value to return if the property is not found
+ * @return unsigned integer value, if found, ordefault_valif not
+ */
+unsigned int fdtdec_get_uint(const void *blob, int node, const char*prop_name,include/fdtdec.h +3
-0+ unsigned int default_val); + +/** * Get a variable-sized number from a property * * This reads a number from one or more cells. lib/fdtdec_common.c +2
-0@@ -36,3 +36,21 @@ int fdtdec_get_int(const void *blob, int node, const char *prop_name, debug("(not found)\n");return default_val; } + +unsigned int fdtdec_get_uint(const void *blob, int node, const char
*prop_name,lib/fdtdec_common.c +16
-0+ unsigned int default_val) +{ +const int *cell; +int len; + +debug ("%s: %s: " , __func__, prop_name); + cell =fdt_getprop (blob, node, prop_name, &len); +if (cell && len >=sizeof (unsigned int )) { +unsigned int val =fdt32_to_cpu (cell[0 ]); + +debug ("%#x (%d)\n" , val, val); +return val; + } +debug ("(not found)\n" ); +return default_val; +}
PATCH v4 5/5 lib, fdt: Adding fdtdec_get_u32 function
Quoted 1 line · Chin Liang See
Hi Marek,
Hi!
Quoted 7 lines · marex at denx.de
Quoted 6 lines · Chin Liang See
Quoted 5 lines
From
3b86e60182b87a96f2e5e2236df7a877c9a8c468Mon Sep 17 00:00:00 2001
From: Chin Liang See <[email protected]>
Date: Thu, 15 Oct 2015 14:04:39 +0800
Subject: [PATCH v4 5/5] lib, fdt: Addingfdtdec_get_u32function
Quoted 8 lines
Quoted 5 lines
Quoted 2 lines
Adding
fdtdec_get_u32function which is the
unsigned version forfdtdec_get_intBut the function you added is named
fdtdec_get_uint(), notfdtdec_get_u32();-)Good catch, miss out this.
Will fix this.
Thanks ! :)
Best regards,
Marek Vasut