diff options
Diffstat (limited to 'include/linux/of.h')
-rw-r--r-- | include/linux/of.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/include/linux/of.h b/include/linux/of.h index 257994a420f3..a8b9dad90c64 100644 --- a/include/linux/of.h +++ b/include/linux/of.h | |||
@@ -76,6 +76,25 @@ struct of_phandle_args { | |||
76 | 76 | ||
77 | extern int of_node_add(struct device_node *node); | 77 | extern int of_node_add(struct device_node *node); |
78 | 78 | ||
79 | /* initialize a node */ | ||
80 | extern struct kobj_type of_node_ktype; | ||
81 | static inline void of_node_init(struct device_node *node) | ||
82 | { | ||
83 | kobject_init(&node->kobj, &of_node_ktype); | ||
84 | } | ||
85 | |||
86 | /* true when node is initialized */ | ||
87 | static inline int of_node_is_initialized(struct device_node *node) | ||
88 | { | ||
89 | return node && node->kobj.state_initialized; | ||
90 | } | ||
91 | |||
92 | /* true when node is attached (i.e. present on sysfs) */ | ||
93 | static inline int of_node_is_attached(struct device_node *node) | ||
94 | { | ||
95 | return node && node->kobj.state_in_sysfs; | ||
96 | } | ||
97 | |||
79 | #ifdef CONFIG_OF_DYNAMIC | 98 | #ifdef CONFIG_OF_DYNAMIC |
80 | extern struct device_node *of_node_get(struct device_node *node); | 99 | extern struct device_node *of_node_get(struct device_node *node); |
81 | extern void of_node_put(struct device_node *node); | 100 | extern void of_node_put(struct device_node *node); |