]> git.ipfire.org Git - people/ms/u-boot.git/commitdiff
dm: ofnode: rename ofnode_read_prop() to ofnode_get_property()
authorMasahiro Yamada <yamada.masahiro@socionext.com>
Thu, 22 Jun 2017 07:54:05 +0000 (16:54 +0900)
committerSimon Glass <sjg@chromium.org>
Tue, 11 Jul 2017 16:08:20 +0000 (10:08 -0600)
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>
drivers/core/lists.c
drivers/core/ofnode.c
drivers/core/read.c
drivers/misc/cros_ec_sandbox.c
drivers/pci/pci-uclass.c
drivers/pinctrl/pinctrl-uclass.c
include/dm/ofnode.h
include/dm/read.h

index b79f26dbe6c9bd5709a1fc989269fe6733630394..6067914e8117e076cadd7daf109c06c16cece582 100644 (file)
@@ -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);
index d9441c849f0e34a4b9d4265fc42a9c92a8052283..372d07a0c9395dd78a18956bba9cdb226cbdadaa 100644 (file)
@@ -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;
 
index 36293ba3263843349c92eca89b43856669da4e57..eafe727f037391efa4aeb47ee7aa6af91647c226 100644 (file)
@@ -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)
index c96e26e6b782c41436a1e7e53f538cfe14270d72..5924adee408551ba336fbef9594bb1d00c9f9bbf 100644 (file)
@@ -197,7 +197,7 @@ static int keyscan_read_fdt_matrix(struct ec_state *ec, ofnode node)
        int upto;
        int len;
 
-       cell = ofnode_read_prop(node, "linux,keymap", &len);
+       cell = ofnode_get_property(node, "linux,keymap", &len);
        ec->matrix_count = len / 4;
        ec->matrix = calloc(ec->matrix_count, sizeof(*ec->matrix));
        if (!ec->matrix) {
index 42230405412c6406c4563770952511f135f53b00..86df141d6071201d7aecf1d8817083db3d7e9d73 100644 (file)
@@ -763,7 +763,7 @@ static int decode_regions(struct pci_controller *hose, ofnode parent_node,
        int len;
        int i;
 
-       prop = ofnode_read_prop(node, "ranges", &len);
+       prop = ofnode_get_property(node, "ranges", &len);
        if (!prop)
                return -EINVAL;
        pci_addr_cells = ofnode_read_simple_addr_cells(node);
index 02e269020df523bba5d74dd65bcdd9e49cf30641..114952a1da361e17cbdf73c6a85301c664dbd140 100644 (file)
@@ -134,7 +134,7 @@ static int pinconfig_post_bind(struct udevice *dev)
                 * If this node has "compatible" property, this is not
                 * a pin configuration node, but a normal device. skip.
                 */
-               ofnode_read_prop(node, "compatible", &ret);
+               ofnode_get_property(node, "compatible", &ret);
                if (ret >= 0)
                        continue;
 
index c3d8db5b16f60e37596a9b2ec1fedf06c7a8ad80..15ad5199c2f017784a0796215da94339e18532eb 100644 (file)
@@ -473,14 +473,14 @@ int ofnode_decode_display_timing(ofnode node, int index,
                                 struct display_timing *config);
 
 /**
- * ofnode_read_prop()- - read a node property
+ * ofnode_get_property()- - get a pointer to the value of a node property
  *
  * @node: node to read
  * @propname: property to read
  * @lenp: place to put length on success
  * @return pointer to property, or NULL if not found
  */
-const u32 *ofnode_read_prop(ofnode node, const char *propname, int *lenp);
+const void *ofnode_get_property(ofnode node, const char *propname, int *lenp);
 
 /**
  * ofnode_is_available() - check if a node is marked available
index 6dd1634675b43abdd16b08181ecf0a9b537fff12..b86a2f5feceb862967e912519003ff900a641b16 100644 (file)
@@ -446,7 +446,7 @@ static inline int dev_read_phandle(struct udevice *dev)
 static inline 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);
 }
 
 static inline int dev_read_alias_seq(struct udevice *dev, int *devnump)