aboutsummaryrefslogtreecommitdiff
path: root/drivers/core
diff options
context:
space:
mode:
authorMasahiro Yamada2017-06-22 16:54:05 +0900
committerSimon Glass2017-07-11 10:08:20 -0600
commit61e51babdb674e4619165cdc180786af7ec75ae9 (patch)
tree383c6cf77d30ffea66927f25274544a9299a645f /drivers/core
parentcb7dbe1fb017f0a1ad050a9dc91ed2c10cb998e6 (diff)
dm: ofnode: rename ofnode_read_prop() to ofnode_get_property()
This function returns the pointer to the value of a node property. The current name ofnode_read_prop() is confusing. Follow the naming of_get_property() from Linux. The return type (const u32 *) is wrong. 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> Acked-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'drivers/core')
-rw-r--r--drivers/core/lists.c3
-rw-r--r--drivers/core/ofnode.c4
-rw-r--r--drivers/core/read.c2
3 files changed, 4 insertions, 5 deletions
diff --git a/drivers/core/lists.c b/drivers/core/lists.c
index b79f26dbe6c..6067914e811 100644
--- a/drivers/core/lists.c
+++ b/drivers/core/lists.c
@@ -141,8 +141,7 @@ int lists_bind_fdt(struct udevice *parent, ofnode node, struct udevice **devp)
name = ofnode_get_name(node);
dm_dbg("bind node %s\n", name);
- compat_list = (const char *)ofnode_read_prop(node, "compatible",
- &compat_length);
+ compat_list = ofnode_get_property(node, "compatible", &compat_length);
if (!compat_list) {
if (compat_length == -FDT_ERR_NOTFOUND) {
dm_dbg("Device '%s' has no compatible string\n", name);
diff --git a/drivers/core/ofnode.c b/drivers/core/ofnode.c
index d9441c849f0..372d07a0c93 100644
--- a/drivers/core/ofnode.c
+++ b/drivers/core/ofnode.c
@@ -432,7 +432,7 @@ int ofnode_decode_display_timing(ofnode parent, int index,
return ret;
}
-const u32 *ofnode_read_prop(ofnode node, const char *propname, int *lenp)
+const void *ofnode_get_property(ofnode node, const char *propname, int *lenp)
{
if (ofnode_is_np(node))
return of_get_property(ofnode_to_np(node), propname, lenp);
@@ -503,7 +503,7 @@ int ofnode_read_pci_addr(ofnode node, enum fdt_pci_space type,
* #size-cells. They need to be 3 and 2 accordingly. However,
* for simplicity we skip the check here.
*/
- cell = ofnode_read_prop(node, propname, &len);
+ cell = ofnode_get_property(node, propname, &len);
if (!cell)
goto fail;
diff --git a/drivers/core/read.c b/drivers/core/read.c
index 36293ba3263..eafe727f037 100644
--- a/drivers/core/read.c
+++ b/drivers/core/read.c
@@ -116,7 +116,7 @@ int dev_read_phandle(struct udevice *dev)
const u32 *dev_read_prop(struct udevice *dev, const char *propname, int *lenp)
{
- return ofnode_read_prop(dev_ofnode(dev), propname, lenp);
+ return ofnode_get_property(dev_ofnode(dev), propname, lenp);
}
int dev_read_alias_seq(struct udevice *dev, int *devnump)