aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/of.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/of.h')
-rw-r--r--include/linux/of.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/include/linux/of.h b/include/linux/of.h
index 3bad8d106e0e..bf65335b4d05 100644
--- a/include/linux/of.h
+++ b/include/linux/of.h
@@ -757,4 +757,26 @@ static inline int of_get_available_child_count(const struct device_node *np)
757 return num; 757 return num;
758} 758}
759 759
760#ifdef CONFIG_OF
761#define _OF_DECLARE(table, name, compat, fn, fn_type) \
762 static const struct of_device_id __of_table_##name \
763 __used __section(__##table##_of_table) \
764 = { .compatible = compat, \
765 .data = (fn == (fn_type)NULL) ? fn : fn }
766#else
767#define _OF_DECLARE(table, name, compat, fn, fn_type) \
768 static const struct of_device_id __of_table_##name \
769 __attribute__((unused)) \
770 = { .compatible = compat, \
771 .data = (fn == (fn_type)NULL) ? fn : fn }
772#endif
773
774typedef int (*of_init_fn_2)(struct device_node *, struct device_node *);
775typedef void (*of_init_fn_1)(struct device_node *);
776
777#define OF_DECLARE_1(table, name, compat, fn) \
778 _OF_DECLARE(table, name, compat, fn, of_init_fn_1)
779#define OF_DECLARE_2(table, name, compat, fn) \
780 _OF_DECLARE(table, name, compat, fn, of_init_fn_2)
781
760#endif /* _LINUX_OF_H */ 782#endif /* _LINUX_OF_H */