From 08dd5af735c05fa799f59fca1613362d4c7935f0 Mon Sep 17 00:00:00 2001 From: Uwe Kleine-König Date: Mon, 16 Jan 2017 09:04:57 +0100 Subject: of: provide for_each_matching_node_from MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is for_each_matching_node for a given root similar to the other ..._from functions. Signed-off-by: Uwe Kleine-König Signed-off-by: Sascha Hauer --- include/of.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/include/of.h b/include/of.h index ed6e870473..e3bb452b86 100644 --- a/include/of.h +++ b/include/of.h @@ -665,9 +665,11 @@ static inline struct device_node *of_find_matching_node( { return of_find_matching_node_and_match(from, matches, NULL); } -#define for_each_matching_node(dn, matches) \ - for (dn = of_find_matching_node(NULL, matches); dn; \ +#define for_each_matching_node_from(dn, root, matches) \ + for (dn = of_find_matching_node(root, matches); dn; \ dn = of_find_matching_node(dn, matches)) +#define for_each_matching_node(dn, matches) \ + for_each_matching_node_from(dn, NULL, matches) #define for_each_matching_node_and_match(dn, matches, match) \ for (dn = of_find_matching_node_and_match(NULL, matches, match); \ dn; dn = of_find_matching_node_and_match(dn, matches, match)) -- cgit v1.2.3 From ed6620e7e20a292f4ab44ca6519df66d054d4ac4 Mon Sep 17 00:00:00 2001 From: Uwe Kleine-König Date: Mon, 16 Jan 2017 09:01:26 +0100 Subject: bus: mvebu-mbus: fixup correct device tree MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When booting with an external device tree this external tree must be adapted, not the internal tree again. Signed-off-by: Uwe Kleine-König Signed-off-by: Sascha Hauer --- drivers/bus/mvebu-mbus.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/bus/mvebu-mbus.c b/drivers/bus/mvebu-mbus.c index 735fa323c4..df5f7a32d3 100644 --- a/drivers/bus/mvebu-mbus.c +++ b/drivers/bus/mvebu-mbus.c @@ -754,7 +754,7 @@ static int mvebu_mbus_of_fixup(struct device_node *root, void *context) { struct device_node *np; - for_each_matching_node(np, mvebu_mbus_dt_ids) { + for_each_matching_node_from(np, root, mvebu_mbus_dt_ids) { struct property *p; int n, pa, na, ns, lenp, size; u32 *ranges; -- cgit v1.2.3