summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHauke Mehrtens <hauke@hauke-m.de>2014-12-20 16:01:31 +0100
committerHauke Mehrtens <hauke@hauke-m.de>2014-12-20 20:35:49 +0100
commit0a73091bd4001977812dafc5a1e1a4648861b8ac (patch)
tree92ba2b7d8d0657b263e1c876948dbf24894ea10a
parentf1309fb8c18f8471415b4b2defbd72ff5fb5a859 (diff)
header: add for_each_compatible_node()
for_each_compatible_node() is defined in a CONFIG_OF condition on older kernel versions. Now some drivers are use it when CONFIG_OF is not set, add it always when it is not already there. Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
-rw-r--r--backport/backport-include/linux/of.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/backport/backport-include/linux/of.h b/backport/backport-include/linux/of.h
index f2a8ab47..6d0be53f 100644
--- a/backport/backport-include/linux/of.h
+++ b/backport/backport-include/linux/of.h
@@ -114,4 +114,10 @@ static inline void of_node_put(struct device_node *node) { }
#endif /* CONFIG_OF */
#endif /* of_match_ptr */
+#ifndef for_each_compatible_node
+#define for_each_compatible_node(dn, type, compatible) \
+ for (dn = of_find_compatible_node(NULL, type, compatible); dn; \
+ dn = of_find_compatible_node(dn, type, compatible))
+#endif /* for_each_compatible_node */
+
#endif /* _COMPAT_LINUX_OF_H */