[PATCH 19/22] OF: base: remove of_tree_for_each_node from public API
Sebastian Hesselbarth
sebastian.hesselbarth at gmail.com
Tue Jun 18 13:30:04 EDT 2013
This patch converts users of of_tree_for_each_node to recently added
for_eacg_compatible_node helper. Also of_tree_for_each_node is removed
from public OF API.
Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth at gmail.com>
---
Cc: barebox at lists.infradead.org
---
arch/arm/boards/at91sam9x5ek/hw_version.c | 10 +++-------
arch/arm/boards/highbank/init.c | 16 ++++++----------
drivers/of/base.c | 8 ++++++++
include/of.h | 8 --------
4 files changed, 17 insertions(+), 25 deletions(-)
diff --git a/arch/arm/boards/at91sam9x5ek/hw_version.c b/arch/arm/boards/at91sam9x5ek/hw_version.c
index 91af331..426bd35 100644
--- a/arch/arm/boards/at91sam9x5ek/hw_version.c
+++ b/arch/arm/boards/at91sam9x5ek/hw_version.c
@@ -234,13 +234,9 @@ static int cm_cogent_fixup(struct device_node *root)
int ret;
struct device_node *node;
- of_tree_for_each_node(node, root) {
- struct device_node *slotnode;
-
- if (!of_device_is_compatible(node, "atmel,hsmci"))
- continue;
-
- slotnode = of_find_child_by_name(node, "slot");
+ for_each_compatible_node(node, NULL, "atmel,hsmci") {
+ struct device_node *slotnode =
+ of_find_child_by_name(node, "slot");
if (!slotnode)
continue;
diff --git a/arch/arm/boards/highbank/init.c b/arch/arm/boards/highbank/init.c
index 1aa713b..46ecc88 100644
--- a/arch/arm/boards/highbank/init.c
+++ b/arch/arm/boards/highbank/init.c
@@ -35,19 +35,15 @@ static int hb_fixup(struct device_node *root)
__be32 latency;
if (!(reg & HB_PWRDOM_STAT_SATA)) {
- of_tree_for_each_node(node, root) {
- if (of_device_is_compatible(node, "calxeda,hb-ahci"))
- of_set_property(node, "status", "disabled",
- sizeof("disabled"), 1);
- }
+ for_each_compatible_node(node, NULL, "calxeda,hb-ahci")
+ of_set_property(node, "status", "disabled",
+ sizeof("disabled"), 1);
}
if (!(reg & HB_PWRDOM_STAT_EMMC)) {
- of_tree_for_each_node(node, root) {
- if (of_device_is_compatible(node, "calxeda,hb-sdhci"))
- of_set_property(node, "status", "disabled",
- sizeof("disabled"), 1);
- }
+ for_each_compatible_node(node, NULL, "calxeda,hb-sdhci")
+ of_set_property(node, "status", "disabled",
+ sizeof("disabled"), 1);
}
if ((opp_table[0] >> 16) != HB_OPP_VERSION)
diff --git a/drivers/of/base.c b/drivers/of/base.c
index 489fa89..94a5c61 100644
--- a/drivers/of/base.c
+++ b/drivers/of/base.c
@@ -28,6 +28,14 @@
#include <linux/amba/bus.h>
#include <linux/err.h>
+/*
+ * Iterate over all nodes of a tree. As a devicetree does not
+ * have a dedicated list head, the start node (usually the root
+ * node) will not be iterated over.
+ */
+#define of_tree_for_each_node(node, root) \
+ list_for_each_entry(node, &root->list, list)
+
/**
* struct alias_prop - Alias property in 'aliases' node
* @link: List node to link the structure in aliases_lookup list
diff --git a/include/of.h b/include/of.h
index 0306742..0797dbe 100644
--- a/include/of.h
+++ b/include/of.h
@@ -85,14 +85,6 @@ int of_modalias_node(struct device_node *node, char *modalias, int len);
#define device_node_for_nach_child(node, child) \
list_for_each_entry(child, &node->children, parent_list)
-/*
- * Iterate over all nodes of a tree. As a devicetree does not
- * have a dedicated list head, the start node (usually the root
- * node) will not be iterated over.
- */
-#define of_tree_for_each_node(node, root) \
- list_for_each_entry(node, &root->list, list)
-
/* Helper to read a big number; size is in cells (not bytes) */
static inline u64 of_read_number(const __be32 *cell, int size)
{
--
1.7.2.5
More information about the barebox
mailing list