4 * Definitions for talking to the Open Firmware PROM on
5 * Power Macintosh and other computers.
7 * Copyright (C) 1996-2005 Paul Mackerras.
9 * Updates for PPC64 by Peter Bergner & David Engebretsen, IBM Corp.
10 * Updates for SPARC64 by David S. Miller
11 * Derived from PowerPC and Sparc prom.h files by Stephen Rothwell, IBM Corp.
13 * This program is free software; you can redistribute it and/or
14 * modify it under the terms of the GNU General Public License
15 * as published by the Free Software Foundation; either version
16 * 2 of the License, or (at your option) any later version.
18 #include <linux/types.h>
19 #include <linux/bitops.h>
20 #include <linux/errno.h>
21 #include <linux/kobject.h>
22 #include <linux/mod_devicetable.h>
23 #include <linux/spinlock.h>
24 #include <linux/topology.h>
25 #include <linux/notifier.h>
26 #include <linux/list.h>
28 #include <asm/byteorder.h>
29 #include <asm/errno.h>
38 struct property *next;
40 unsigned int unique_id;
41 struct bin_attribute attr;
44 #if defined(CONFIG_SPARC)
45 struct of_irq_controller;
52 const char *full_name;
54 struct property *properties;
55 struct property *deadprops; /* removed properties */
56 struct device_node *parent;
57 struct device_node *child;
58 struct device_node *sibling;
59 struct device_node *next; /* next device of same type */
60 struct device_node *allnext; /* next in list of all nodes */
64 #if defined(CONFIG_SPARC)
65 const char *path_component_name;
66 unsigned int unique_id;
67 struct of_irq_controller *irq_trans;
71 #define MAX_PHANDLE_ARGS 8
72 struct of_phandle_args {
73 struct device_node *np;
75 uint32_t args[MAX_PHANDLE_ARGS];
78 struct of_reconfig_data {
79 struct device_node *dn;
80 struct property *prop;
81 struct property *old_prop;
84 /* initialize a node */
85 extern struct kobj_type of_node_ktype;
86 static inline void of_node_init(struct device_node *node)
88 kobject_init(&node->kobj, &of_node_ktype);
91 /* true when node is initialized */
92 static inline int of_node_is_initialized(struct device_node *node)
94 return node && node->kobj.state_initialized;
97 /* true when node is attached (i.e. present on sysfs) */
98 static inline int of_node_is_attached(struct device_node *node)
100 return node && node->kobj.state_in_sysfs;
103 #ifdef CONFIG_OF_DYNAMIC
104 extern struct device_node *of_node_get(struct device_node *node);
105 extern void of_node_put(struct device_node *node);
106 #else /* CONFIG_OF_DYNAMIC */
107 /* Dummy ref counting routines - to be implemented later */
108 static inline struct device_node *of_node_get(struct device_node *node)
112 static inline void of_node_put(struct device_node *node) { }
113 #endif /* !CONFIG_OF_DYNAMIC */
117 /* Pointer for first entry in chain of all nodes. */
118 extern struct device_node *of_allnodes;
119 extern struct device_node *of_chosen;
120 extern struct device_node *of_aliases;
121 extern raw_spinlock_t devtree_lock;
123 static inline bool of_have_populated_dt(void)
125 return of_allnodes != NULL;
128 static inline bool of_node_is_root(const struct device_node *node)
130 return node && (node->parent == NULL);
133 static inline int of_node_check_flag(struct device_node *n, unsigned long flag)
135 return test_bit(flag, &n->_flags);
138 static inline int of_node_test_and_set_flag(struct device_node *n,
141 return test_and_set_bit(flag, &n->_flags);
144 static inline void of_node_set_flag(struct device_node *n, unsigned long flag)
146 set_bit(flag, &n->_flags);
149 static inline void of_node_clear_flag(struct device_node *n, unsigned long flag)
151 clear_bit(flag, &n->_flags);
154 static inline int of_property_check_flag(struct property *p, unsigned long flag)
156 return test_bit(flag, &p->_flags);
159 static inline void of_property_set_flag(struct property *p, unsigned long flag)
161 set_bit(flag, &p->_flags);
164 static inline void of_property_clear_flag(struct property *p, unsigned long flag)
166 clear_bit(flag, &p->_flags);
169 extern struct device_node *of_find_all_nodes(struct device_node *prev);
172 * OF address retrieval & translation
175 /* Helper to read a big number; size is in cells (not bytes) */
176 static inline u64 of_read_number(const __be32 *cell, int size)
180 r = (r << 32) | be32_to_cpu(*(cell++));
184 /* Like of_read_number, but we want an unsigned long result */
185 static inline unsigned long of_read_ulong(const __be32 *cell, int size)
187 /* toss away upper bits if unsigned long is smaller than u64 */
188 return of_read_number(cell, size);
191 #include <asm/prom.h>
193 /* Default #address and #size cells. Allow arch asm/prom.h to override */
194 #if !defined(OF_ROOT_NODE_ADDR_CELLS_DEFAULT)
195 #define OF_ROOT_NODE_ADDR_CELLS_DEFAULT 1
196 #define OF_ROOT_NODE_SIZE_CELLS_DEFAULT 1
199 /* Default string compare functions, Allow arch asm/prom.h to override */
200 #if !defined(of_compat_cmp)
201 #define of_compat_cmp(s1, s2, l) strcasecmp((s1), (s2))
202 #define of_prop_cmp(s1, s2) strcmp((s1), (s2))
203 #define of_node_cmp(s1, s2) strcasecmp((s1), (s2))
206 /* flag descriptions */
207 #define OF_DYNAMIC 1 /* node and properties were allocated via kmalloc */
208 #define OF_DETACHED 2 /* node has been detached from the device tree */
209 #define OF_POPULATED 3 /* device already created for the node */
210 #define OF_POPULATED_BUS 4 /* of_platform_populate recursed to children of this node */
212 #define OF_IS_DYNAMIC(x) test_bit(OF_DYNAMIC, &x->_flags)
213 #define OF_MARK_DYNAMIC(x) set_bit(OF_DYNAMIC, &x->_flags)
215 #define OF_BAD_ADDR ((u64)-1)
217 static inline const char *of_node_full_name(const struct device_node *np)
219 return np ? np->full_name : "<no-node>";
222 #define for_each_of_allnodes(dn) \
223 for (dn = of_allnodes; dn; dn = dn->allnext)
224 extern struct device_node *of_find_node_by_name(struct device_node *from,
226 #define for_each_node_by_name(dn, name) \
227 for (dn = of_find_node_by_name(NULL, name); dn; \
228 dn = of_find_node_by_name(dn, name))
229 extern struct device_node *of_find_node_by_type(struct device_node *from,
231 #define for_each_node_by_type(dn, type) \
232 for (dn = of_find_node_by_type(NULL, type); dn; \
233 dn = of_find_node_by_type(dn, type))
234 extern struct device_node *of_find_compatible_node(struct device_node *from,
235 const char *type, const char *compat);
236 #define for_each_compatible_node(dn, type, compatible) \
237 for (dn = of_find_compatible_node(NULL, type, compatible); dn; \
238 dn = of_find_compatible_node(dn, type, compatible))
239 extern struct device_node *of_find_matching_node_and_match(
240 struct device_node *from,
241 const struct of_device_id *matches,
242 const struct of_device_id **match);
243 static inline struct device_node *of_find_matching_node(
244 struct device_node *from,
245 const struct of_device_id *matches)
247 return of_find_matching_node_and_match(from, matches, NULL);
249 #define for_each_matching_node(dn, matches) \
250 for (dn = of_find_matching_node(NULL, matches); dn; \
251 dn = of_find_matching_node(dn, matches))
252 #define for_each_matching_node_and_match(dn, matches, match) \
253 for (dn = of_find_matching_node_and_match(NULL, matches, match); \
254 dn; dn = of_find_matching_node_and_match(dn, matches, match))
255 extern struct device_node *of_find_node_by_path(const char *path);
256 extern struct device_node *of_find_node_by_phandle(phandle handle);
257 extern struct device_node *of_get_parent(const struct device_node *node);
258 extern struct device_node *of_get_next_parent(struct device_node *node);
259 extern struct device_node *of_get_next_child(const struct device_node *node,
260 struct device_node *prev);
261 extern struct device_node *of_get_next_available_child(
262 const struct device_node *node, struct device_node *prev);
264 extern struct device_node *of_get_child_by_name(const struct device_node *node,
266 #define for_each_child_of_node(parent, child) \
267 for (child = of_get_next_child(parent, NULL); child != NULL; \
268 child = of_get_next_child(parent, child))
270 #define for_each_available_child_of_node(parent, child) \
271 for (child = of_get_next_available_child(parent, NULL); child != NULL; \
272 child = of_get_next_available_child(parent, child))
274 static inline int of_get_child_count(const struct device_node *np)
276 struct device_node *child;
279 for_each_child_of_node(np, child)
285 extern struct device_node *of_find_node_with_property(
286 struct device_node *from, const char *prop_name);
287 #define for_each_node_with_property(dn, prop_name) \
288 for (dn = of_find_node_with_property(NULL, prop_name); dn; \
289 dn = of_find_node_with_property(dn, prop_name))
291 extern struct property *of_find_property(const struct device_node *np,
294 extern int of_property_count_elems_of_size(const struct device_node *np,
295 const char *propname, int elem_size);
296 extern int of_property_read_u32_index(const struct device_node *np,
297 const char *propname,
298 u32 index, u32 *out_value);
300 extern int of_property_read_u8_array_tp(const struct device_node *np,
301 const char *propname, u8 *out_values, size_t sz);
303 extern int of_property_read_u8_array(const struct device_node *np,
304 const char *propname, u8 *out_values, size_t sz);
305 extern int of_property_read_u16_array(const struct device_node *np,
306 const char *propname, u16 *out_values, size_t sz);
307 extern int of_property_read_u32_array(const struct device_node *np,
308 const char *propname,
311 extern int of_property_read_u64(const struct device_node *np,
312 const char *propname, u64 *out_value);
314 extern int of_property_read_string(struct device_node *np,
315 const char *propname,
316 const char **out_string);
317 extern int of_property_match_string(struct device_node *np,
318 const char *propname,
320 extern int of_property_read_string_helper(struct device_node *np,
321 const char *propname,
322 const char **out_strs, size_t sz, int index);
323 extern int of_device_is_compatible(const struct device_node *device,
325 extern int of_device_is_available(const struct device_node *device);
326 extern const void *of_get_property(const struct device_node *node,
329 extern struct device_node *of_get_cpu_node(int cpu, unsigned int *thread);
330 #define for_each_property_of_node(dn, pp) \
331 for (pp = dn->properties; pp != NULL; pp = pp->next)
333 extern int of_n_addr_cells(struct device_node *np);
334 extern int of_n_size_cells(struct device_node *np);
335 extern const struct of_device_id *of_match_node(
336 const struct of_device_id *matches, const struct device_node *node);
337 extern int of_modalias_node(struct device_node *node, char *modalias, int len);
338 extern struct device_node *of_parse_phandle(const struct device_node *np,
339 const char *phandle_name,
341 extern int of_parse_phandle_with_args(const struct device_node *np,
342 const char *list_name, const char *cells_name, int index,
343 struct of_phandle_args *out_args);
344 extern int of_parse_phandle_with_fixed_args(const struct device_node *np,
345 const char *list_name, int cells_count, int index,
346 struct of_phandle_args *out_args);
347 extern int of_count_phandle_with_args(const struct device_node *np,
348 const char *list_name, const char *cells_name);
350 extern void of_alias_scan(void * (*dt_alloc)(u64 size, u64 align));
351 extern int of_alias_get_id(struct device_node *np, const char *stem);
353 extern int of_machine_is_compatible(const char *compat);
355 extern int of_add_property(struct device_node *np, struct property *prop);
356 extern int of_remove_property(struct device_node *np, struct property *prop);
357 extern int of_update_property(struct device_node *np, struct property *newprop);
359 /* For updating the device tree at runtime */
360 #define OF_RECONFIG_ATTACH_NODE 0x0001
361 #define OF_RECONFIG_DETACH_NODE 0x0002
362 #define OF_RECONFIG_ADD_PROPERTY 0x0003
363 #define OF_RECONFIG_REMOVE_PROPERTY 0x0004
364 #define OF_RECONFIG_UPDATE_PROPERTY 0x0005
366 extern int of_attach_node(struct device_node *);
367 extern int of_detach_node(struct device_node *);
369 #define of_match_ptr(_ptr) (_ptr)
372 * struct property *prop;
376 * of_property_for_each_u32(np, "propname", prop, p, u)
377 * printk("U32 value: %x\n", u);
379 const __be32 *of_prop_next_u32(struct property *prop, const __be32 *cur,
381 #define of_property_for_each_u32(np, propname, prop, p, u) \
382 for (prop = of_find_property(np, propname, NULL), \
383 p = of_prop_next_u32(prop, NULL, &u); \
385 p = of_prop_next_u32(prop, p, &u))
388 * struct property *prop;
391 * of_property_for_each_string(np, "propname", prop, s)
392 * printk("String value: %s\n", s);
394 const char *of_prop_next_string(struct property *prop, const char *cur);
395 #define of_property_for_each_string(np, propname, prop, s) \
396 for (prop = of_find_property(np, propname, NULL), \
397 s = of_prop_next_string(prop, NULL); \
399 s = of_prop_next_string(prop, s))
401 int of_device_is_stdout_path(struct device_node *dn);
403 #else /* CONFIG_OF */
405 static inline const char* of_node_full_name(struct device_node *np)
410 static inline struct device_node *of_find_node_by_name(struct device_node *from,
416 static inline struct device_node *of_find_node_by_path(const char *path)
421 static inline struct device_node *of_get_parent(const struct device_node *node)
426 static inline bool of_have_populated_dt(void)
431 #define for_each_child_of_node(parent, child) \
434 static inline struct device_node *of_get_child_by_name(
435 const struct device_node *node,
441 static inline int of_get_child_count(const struct device_node *np)
446 static inline int of_device_is_compatible(const struct device_node *device,
452 static inline int of_device_is_available(const struct device_node *device)
457 static inline struct property *of_find_property(const struct device_node *np,
464 static inline struct device_node *of_find_compatible_node(
465 struct device_node *from,
472 static inline int of_property_count_elems_of_size(const struct device_node *np,
473 const char *propname, int elem_size)
478 static inline int of_property_read_u32_index(const struct device_node *np,
479 const char *propname, u32 index, u32 *out_value)
484 static inline int of_property_read_u8_array_tp(const struct device_node *np,
485 const char *propname, u8 *out_values, size_t sz)
492 static inline int of_property_read_u8_array(const struct device_node *np,
493 const char *propname, u8 *out_values, size_t sz)
498 static inline int of_property_read_u16_array(const struct device_node *np,
499 const char *propname, u16 *out_values, size_t sz)
504 static inline int of_property_read_u32_array(const struct device_node *np,
505 const char *propname,
506 u32 *out_values, size_t sz)
511 static inline int of_property_read_string(struct device_node *np,
512 const char *propname,
513 const char **out_string)
518 static inline int of_property_read_string_helper(struct device_node *np,
519 const char *propname,
520 const char **out_strs, size_t sz, int index)
525 static inline const void *of_get_property(const struct device_node *node,
532 static inline struct device_node *of_get_cpu_node(int cpu,
533 unsigned int *thread)
538 static inline int of_property_read_u64(const struct device_node *np,
539 const char *propname, u64 *out_value)
544 static inline int of_property_match_string(struct device_node *np,
545 const char *propname,
551 static inline struct device_node *of_parse_phandle(const struct device_node *np,
552 const char *phandle_name,
558 static inline int of_parse_phandle_with_args(struct device_node *np,
559 const char *list_name,
560 const char *cells_name,
562 struct of_phandle_args *out_args)
567 static inline int of_parse_phandle_with_fixed_args(const struct device_node *np,
568 const char *list_name, int cells_count, int index,
569 struct of_phandle_args *out_args)
574 static inline int of_count_phandle_with_args(struct device_node *np,
575 const char *list_name,
576 const char *cells_name)
581 static inline int of_alias_get_id(struct device_node *np, const char *stem)
586 static inline int of_machine_is_compatible(const char *compat)
591 static inline int of_device_is_stdout_path(struct device_node *dn)
596 #define of_match_ptr(_ptr) NULL
597 #define of_match_node(_matches, _node) NULL
598 #define of_property_for_each_u32(np, propname, prop, p, u) \
600 #define of_property_for_each_string(np, propname, prop, s) \
602 #endif /* CONFIG_OF */
604 #ifndef of_node_to_nid
605 static inline int of_node_to_nid(struct device_node *np)
607 return numa_node_id();
610 #define of_node_to_nid of_node_to_nid
614 * of_property_read_string_array() - Read an array of strings from a multiple
616 * @np: device node from which the property value is to be read.
617 * @propname: name of the property to be searched.
618 * @out_strs: output array of string pointers.
619 * @sz: number of array elements to read.
621 * Search for a property in a device tree node and retrieve a list of
622 * terminated string values (pointer to data, not a copy) in that property.
624 * If @out_strs is NULL, the number of strings in the property is returned.
626 static inline int of_property_read_string_array(struct device_node *np,
627 const char *propname, const char **out_strs,
630 return of_property_read_string_helper(np, propname, out_strs, sz, 0);
634 * of_property_count_strings() - Find and return the number of strings from a
635 * multiple strings property.
636 * @np: device node from which the property value is to be read.
637 * @propname: name of the property to be searched.
639 * Search for a property in a device tree node and retrieve the number of null
640 * terminated string contain in it. Returns the number of strings on
641 * success, -EINVAL if the property does not exist, -ENODATA if property
642 * does not have a value, and -EILSEQ if the string is not null-terminated
643 * within the length of the property data.
645 static inline int of_property_count_strings(struct device_node *np,
646 const char *propname)
648 return of_property_read_string_helper(np, propname, NULL, 0, 0);
652 * of_property_read_string_index() - Find and read a string from a multiple
654 * @np: device node from which the property value is to be read.
655 * @propname: name of the property to be searched.
656 * @index: index of the string in the list of strings
657 * @out_string: pointer to null terminated return string, modified only if
660 * Search for a property in a device tree node and retrieve a null
661 * terminated string value (pointer to data, not a copy) in the list of strings
662 * contained in that property.
663 * Returns 0 on success, -EINVAL if the property does not exist, -ENODATA if
664 * property does not have a value, and -EILSEQ if the string is not
665 * null-terminated within the length of the property data.
667 * The out_string pointer is modified only if a valid string can be decoded.
669 static inline int of_property_read_string_index(struct device_node *np,
670 const char *propname,
671 int index, const char **output)
673 int rc = of_property_read_string_helper(np, propname, output, 1, index);
674 return rc < 0 ? rc : 0;
678 * of_property_count_u8_elems - Count the number of u8 elements in a property
680 * @np: device node from which the property value is to be read.
681 * @propname: name of the property to be searched.
683 * Search for a property in a device node and count the number of u8 elements
684 * in it. Returns number of elements on sucess, -EINVAL if the property does
685 * not exist or its length does not match a multiple of u8 and -ENODATA if the
686 * property does not have a value.
688 static inline int of_property_count_u8_elems(const struct device_node *np,
689 const char *propname)
691 return of_property_count_elems_of_size(np, propname, sizeof(u8));
695 * of_property_count_u16_elems - Count the number of u16 elements in a property
697 * @np: device node from which the property value is to be read.
698 * @propname: name of the property to be searched.
700 * Search for a property in a device node and count the number of u16 elements
701 * in it. Returns number of elements on sucess, -EINVAL if the property does
702 * not exist or its length does not match a multiple of u16 and -ENODATA if the
703 * property does not have a value.
705 static inline int of_property_count_u16_elems(const struct device_node *np,
706 const char *propname)
708 return of_property_count_elems_of_size(np, propname, sizeof(u16));
712 * of_property_count_u32_elems - Count the number of u32 elements in a property
714 * @np: device node from which the property value is to be read.
715 * @propname: name of the property to be searched.
717 * Search for a property in a device node and count the number of u32 elements
718 * in it. Returns number of elements on sucess, -EINVAL if the property does
719 * not exist or its length does not match a multiple of u32 and -ENODATA if the
720 * property does not have a value.
722 static inline int of_property_count_u32_elems(const struct device_node *np,
723 const char *propname)
725 return of_property_count_elems_of_size(np, propname, sizeof(u32));
729 * of_property_count_u64_elems - Count the number of u64 elements in a property
731 * @np: device node from which the property value is to be read.
732 * @propname: name of the property to be searched.
734 * Search for a property in a device node and count the number of u64 elements
735 * in it. Returns number of elements on sucess, -EINVAL if the property does
736 * not exist or its length does not match a multiple of u64 and -ENODATA if the
737 * property does not have a value.
739 static inline int of_property_count_u64_elems(const struct device_node *np,
740 const char *propname)
742 return of_property_count_elems_of_size(np, propname, sizeof(u64));
746 * of_property_read_bool - Findfrom a property
747 * @np: device node from which the property value is to be read.
748 * @propname: name of the property to be searched.
750 * Search for a property in a device node.
751 * Returns true if the property exist false otherwise.
753 static inline bool of_property_read_bool(const struct device_node *np,
754 const char *propname)
756 struct property *prop = of_find_property(np, propname, NULL);
758 return prop ? true : false;
761 static inline int of_property_read_u8(const struct device_node *np,
762 const char *propname,
765 return of_property_read_u8_array(np, propname, out_value, 1);
768 static inline int of_property_read_u16(const struct device_node *np,
769 const char *propname,
772 return of_property_read_u16_array(np, propname, out_value, 1);
775 static inline int of_property_read_u32(const struct device_node *np,
776 const char *propname,
779 return of_property_read_u32_array(np, propname, out_value, 1);
783 * struct of_changeset_entry - Holds a changeset entry
785 * @node: list_head for the log list
786 * @action: notifier action
787 * @np: pointer to the device node affected
788 * @prop: pointer to the property affected
789 * @old_prop: hold a pointer to the original property
791 * Every modification of the device tree during a changeset
792 * is held in a list of of_changeset_entry structures.
793 * That way we can recover from a partial application, or we can
794 * revert the changeset
796 struct of_changeset_entry {
797 struct list_head node;
798 unsigned long action;
799 struct device_node *np;
800 struct property *prop;
801 struct property *old_prop;
805 * struct of_changeset - changeset tracker structure
807 * @entries: list_head for the changeset entries
809 * changesets are a convenient way to apply bulk changes to the
810 * live tree. In case of an error, changes are rolled-back.
811 * changesets live on after initial application, and if not
812 * destroyed after use, they can be reverted in one single call.
814 struct of_changeset {
815 struct list_head entries;
818 enum of_reconfig_change {
819 OF_RECONFIG_NO_CHANGE = 0,
820 OF_RECONFIG_CHANGE_ADD,
821 OF_RECONFIG_CHANGE_REMOVE,
824 #ifdef CONFIG_OF_DYNAMIC
825 extern int of_reconfig_notifier_register(struct notifier_block *);
826 extern int of_reconfig_notifier_unregister(struct notifier_block *);
827 extern int of_reconfig_notify(unsigned long, struct of_reconfig_data *rd);
828 extern int of_reconfig_get_state_change(unsigned long action,
829 struct of_reconfig_data *arg);
831 extern void of_changeset_init(struct of_changeset *ocs);
832 extern void of_changeset_destroy(struct of_changeset *ocs);
833 extern int of_changeset_apply(struct of_changeset *ocs);
834 extern int of_changeset_revert(struct of_changeset *ocs);
835 extern int of_changeset_action(struct of_changeset *ocs,
836 unsigned long action, struct device_node *np,
837 struct property *prop);
839 static inline int of_changeset_attach_node(struct of_changeset *ocs,
840 struct device_node *np)
842 return of_changeset_action(ocs, OF_RECONFIG_ATTACH_NODE, np, NULL);
845 static inline int of_changeset_detach_node(struct of_changeset *ocs,
846 struct device_node *np)
848 return of_changeset_action(ocs, OF_RECONFIG_DETACH_NODE, np, NULL);
851 static inline int of_changeset_add_property(struct of_changeset *ocs,
852 struct device_node *np, struct property *prop)
854 return of_changeset_action(ocs, OF_RECONFIG_ADD_PROPERTY, np, prop);
857 static inline int of_changeset_remove_property(struct of_changeset *ocs,
858 struct device_node *np, struct property *prop)
860 return of_changeset_action(ocs, OF_RECONFIG_REMOVE_PROPERTY, np, prop);
863 static inline int of_changeset_update_property(struct of_changeset *ocs,
864 struct device_node *np, struct property *prop)
866 return of_changeset_action(ocs, OF_RECONFIG_UPDATE_PROPERTY, np, prop);
868 #else /* CONFIG_OF_DYNAMIC */
869 static inline int of_reconfig_notifier_register(struct notifier_block *nb)
873 static inline int of_reconfig_notifier_unregister(struct notifier_block *nb)
877 static inline int of_reconfig_notify(unsigned long action,
878 struct of_reconfig_data *arg)
882 static inline int of_reconfig_get_state_change(unsigned long action,
883 struct of_reconfig_data *arg)
887 #endif /* CONFIG_OF_DYNAMIC */
889 /* CONFIG_OF_RESOLVE api */
890 extern int of_resolve_phandles(struct device_node *tree);
896 #ifdef CONFIG_OF_OVERLAY
898 /* ID based overlays; the API for external users */
899 int of_overlay_create(struct device_node *tree);
900 int of_overlay_destroy(int id);
901 int of_overlay_destroy_all(void);
905 static inline int of_overlay_create(struct device_node *tree)
910 static inline int of_overlay_destroy(int id)
915 static inline int of_overlay_destroy_all(void)
922 #endif /* _LINUX_OF_H */