diff mbox

dm: ofnode: change return type of dev_read_prop() to opaque pointer

Message ID 1500261519-4743-1-git-send-email-yamada.masahiro@socionext.com
State Accepted
Commit fd73621cba2c4b20e8a65e0b4c40c9026018e434
Headers show

Commit Message

Masahiro Yamada July 17, 2017, 3:18 a.m. UTC
DT property values can be strings as well as integers.  This is why
of_get_property/fdt_getprop returns an opaque pointer.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---

 drivers/core/read.c | 2 +-
 include/dm/read.h   | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

Comments

Simon Glass July 28, 2017, 4:19 a.m. UTC | #1
On 16 July 2017 at 21:18, Masahiro Yamada <yamada.masahiro@socionext.com> wrote:
> DT property values can be strings as well as integers.  This is why
> of_get_property/fdt_getprop returns an opaque pointer.
>
> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
> ---
>
>  drivers/core/read.c | 2 +-
>  include/dm/read.h   | 6 +++---
>  2 files changed, 4 insertions(+), 4 deletions(-)
>

Acked-by: Simon Glass <sjg@chromium.org>
Simon Glass July 28, 2017, 6:44 p.m. UTC | #2
On 16 July 2017 at 21:18, Masahiro Yamada <yamada.masahiro@socionext.com> wrote:
> DT property values can be strings as well as integers.  This is why
> of_get_property/fdt_getprop returns an opaque pointer.
>
> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
> ---
>
>  drivers/core/read.c | 2 +-
>  include/dm/read.h   | 6 +++---
>  2 files changed, 4 insertions(+), 4 deletions(-)
>

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

Applied to u-boot-dm, thanks!
diff mbox

Patch

diff --git a/drivers/core/read.c b/drivers/core/read.c
index eafe727f0373..85705836938c 100644
--- a/drivers/core/read.c
+++ b/drivers/core/read.c
@@ -114,7 +114,7 @@  int dev_read_phandle(struct udevice *dev)
 		return fdt_get_phandle(gd->fdt_blob, ofnode_to_offset(node));
 }
 
-const u32 *dev_read_prop(struct udevice *dev, const char *propname, int *lenp)
+const void *dev_read_prop(struct udevice *dev, const char *propname, int *lenp)
 {
 	return ofnode_get_property(dev_ofnode(dev), propname, lenp);
 }
diff --git a/include/dm/read.h b/include/dm/read.h
index b86a2f5feceb..edf468fdd195 100644
--- a/include/dm/read.h
+++ b/include/dm/read.h
@@ -266,7 +266,7 @@  int dev_read_phandle(struct udevice *dev);
  * @lenp: place to put length on success
  * @return pointer to property, or NULL if not found
  */
-const u32 *dev_read_prop(struct udevice *dev, const char *propname, int *lenp);
+const void *dev_read_prop(struct udevice *dev, const char *propname, int *lenp);
 
 /**
  * dev_read_alias_seq() - Get the alias sequence number of a node
@@ -443,8 +443,8 @@  static inline int dev_read_phandle(struct udevice *dev)
 	return fdt_get_phandle(gd->fdt_blob, dev_of_offset(dev));
 }
 
-static inline const u32 *dev_read_prop(struct udevice *dev,
-				       const char *propname, int *lenp)
+static inline const void *dev_read_prop(struct udevice *dev,
+					const char *propname, int *lenp)
 {
 	return ofnode_get_property(dev_ofnode(dev), propname, lenp);
 }