summaryrefslogtreecommitdiff
path: root/drivers/core
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2017-07-29 11:43:51 -0400
committerTom Rini <trini@konsulko.com>2017-07-29 11:43:51 -0400
commit211aaf309cde193918f9a19b0b010acebfd80a82 (patch)
tree2c4ee988b53b504a64ebe286ebb6a113603056de /drivers/core
parent32ca40bf8b95fa1312de52109b84f888e2ea3642 (diff)
parentb108d8a0de3ddc6fe8aae55bc54e3edc69b4778b (diff)
Merge git://git.denx.de/u-boot-usb
Diffstat (limited to 'drivers/core')
-rw-r--r--drivers/core/of_access.c7
-rw-r--r--drivers/core/ofnode.c12
2 files changed, 19 insertions, 0 deletions
diff --git a/drivers/core/of_access.c b/drivers/core/of_access.c
index 2bb23eef88..c31cba7fd6 100644
--- a/drivers/core/of_access.c
+++ b/drivers/core/of_access.c
@@ -665,6 +665,13 @@ int of_parse_phandle_with_args(const struct device_node *np,
index, out_args);
}
+int of_count_phandle_with_args(const struct device_node *np,
+ const char *list_name, const char *cells_name)
+{
+ return __of_parse_phandle_with_args(np, list_name, cells_name, 0,
+ -1, NULL);
+}
+
static void of_alias_add(struct alias_prop *ap, struct device_node *np,
int id, const char *stem, int stem_len)
{
diff --git a/drivers/core/ofnode.c b/drivers/core/ofnode.c
index c3fb0ae7b9..c1a2e9f0da 100644
--- a/drivers/core/ofnode.c
+++ b/drivers/core/ofnode.c
@@ -315,6 +315,18 @@ int ofnode_parse_phandle_with_args(ofnode node, const char *list_name,
return 0;
}
+int ofnode_count_phandle_with_args(ofnode node, const char *list_name,
+ const char *cells_name)
+{
+ if (ofnode_is_np(node))
+ return of_count_phandle_with_args(ofnode_to_np(node),
+ list_name, cells_name);
+ else
+ return fdtdec_parse_phandle_with_args(gd->fdt_blob,
+ ofnode_to_offset(node), list_name, cells_name,
+ 0, -1, NULL);
+}
+
ofnode ofnode_path(const char *path)
{
if (of_live_active())