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_get_parent(const struct device_node *node)
421 static inline bool of_have_populated_dt(void)
426 #define for_each_child_of_node(parent, child) \
429 static inline struct device_node *of_get_child_by_name(
430 const struct device_node *node,
436 static inline int of_get_child_count(const struct device_node *np)
441 static inline int of_device_is_compatible(const struct device_node *device,
447 static inline int of_device_is_available(const struct device_node *device)
452 static inline struct property *of_find_property(const struct device_node *np,
459 static inline struct device_node *of_find_compatible_node(
460 struct device_node *from,
467 static inline int of_property_count_elems_of_size(const struct device_node *np,
468 const char *propname, int elem_size)
473 static inline int of_property_read_u32_index(const struct device_node *np,
474 const char *propname, u32 index, u32 *out_value)
479 static inline int of_property_read_u8_array_tp(const struct device_node *np,
480 const char *propname, u8 *out_values, size_t sz)
487 static inline int of_property_read_u8_array(const struct device_node *np,
488 const char *propname, u8 *out_values, size_t sz)
493 static inline int of_property_read_u16_array(const struct device_node *np,
494 const char *propname, u16 *out_values, size_t sz)
499 static inline int of_property_read_u32_array(const struct device_node *np,
500 const char *propname,
501 u32 *out_values, size_t sz)
506 static inline int of_property_read_string(struct device_node *np,
507 const char *propname,
508 const char **out_string)
513 static inline int of_property_read_string_helper(struct device_node *np,
514 const char *propname,
515 const char **out_strs, size_t sz, int index)
520 static inline const void *of_get_property(const struct device_node *node,
527 static inline struct device_node *of_get_cpu_node(int cpu,
528 unsigned int *thread)
533 static inline int of_property_read_u64(const struct device_node *np,
534 const char *propname, u64 *out_value)
539 static inline int of_property_match_string(struct device_node *np,
540 const char *propname,
546 static inline struct device_node *of_parse_phandle(const struct device_node *np,
547 const char *phandle_name,
553 static inline int of_parse_phandle_with_args(struct device_node *np,
554 const char *list_name,
555 const char *cells_name,
557 struct of_phandle_args *out_args)
562 static inline int of_parse_phandle_with_fixed_args(const struct device_node *np,
563 const char *list_name, int cells_count, int index,
564 struct of_phandle_args *out_args)
569 static inline int of_count_phandle_with_args(struct device_node *np,
570 const char *list_name,
571 const char *cells_name)
576 static inline int of_alias_get_id(struct device_node *np, const char *stem)
581 static inline int of_machine_is_compatible(const char *compat)
586 static inline int of_device_is_stdout_path(struct device_node *dn)
591 #define of_match_ptr(_ptr) NULL
592 #define of_match_node(_matches, _node) NULL
593 #define of_property_for_each_u32(np, propname, prop, p, u) \
595 #define of_property_for_each_string(np, propname, prop, s) \
597 #endif /* CONFIG_OF */
599 #ifndef of_node_to_nid
600 static inline int of_node_to_nid(struct device_node *np)
602 return numa_node_id();
605 #define of_node_to_nid of_node_to_nid
609 * of_property_read_string_array() - Read an array of strings from a multiple
611 * @np: device node from which the property value is to be read.
612 * @propname: name of the property to be searched.
613 * @out_strs: output array of string pointers.
614 * @sz: number of array elements to read.
616 * Search for a property in a device tree node and retrieve a list of
617 * terminated string values (pointer to data, not a copy) in that property.
619 * If @out_strs is NULL, the number of strings in the property is returned.
621 static inline int of_property_read_string_array(struct device_node *np,
622 const char *propname, const char **out_strs,
625 return of_property_read_string_helper(np, propname, out_strs, sz, 0);
629 * of_property_count_strings() - Find and return the number of strings from a
630 * multiple strings property.
631 * @np: device node from which the property value is to be read.
632 * @propname: name of the property to be searched.
634 * Search for a property in a device tree node and retrieve the number of null
635 * terminated string contain in it. Returns the number of strings on
636 * success, -EINVAL if the property does not exist, -ENODATA if property
637 * does not have a value, and -EILSEQ if the string is not null-terminated
638 * within the length of the property data.
640 static inline int of_property_count_strings(struct device_node *np,
641 const char *propname)
643 return of_property_read_string_helper(np, propname, NULL, 0, 0);
647 * of_property_read_string_index() - Find and read a string from a multiple
649 * @np: device node from which the property value is to be read.
650 * @propname: name of the property to be searched.
651 * @index: index of the string in the list of strings
652 * @out_string: pointer to null terminated return string, modified only if
655 * Search for a property in a device tree node and retrieve a null
656 * terminated string value (pointer to data, not a copy) in the list of strings
657 * contained in that property.
658 * Returns 0 on success, -EINVAL if the property does not exist, -ENODATA if
659 * property does not have a value, and -EILSEQ if the string is not
660 * null-terminated within the length of the property data.
662 * The out_string pointer is modified only if a valid string can be decoded.
664 static inline int of_property_read_string_index(struct device_node *np,
665 const char *propname,
666 int index, const char **output)
668 int rc = of_property_read_string_helper(np, propname, output, 1, index);
669 return rc < 0 ? rc : 0;
673 * of_property_count_u8_elems - Count the number of u8 elements in a property
675 * @np: device node from which the property value is to be read.
676 * @propname: name of the property to be searched.
678 * Search for a property in a device node and count the number of u8 elements
679 * in it. Returns number of elements on sucess, -EINVAL if the property does
680 * not exist or its length does not match a multiple of u8 and -ENODATA if the
681 * property does not have a value.
683 static inline int of_property_count_u8_elems(const struct device_node *np,
684 const char *propname)
686 return of_property_count_elems_of_size(np, propname, sizeof(u8));
690 * of_property_count_u16_elems - Count the number of u16 elements in a property
692 * @np: device node from which the property value is to be read.
693 * @propname: name of the property to be searched.
695 * Search for a property in a device node and count the number of u16 elements
696 * in it. Returns number of elements on sucess, -EINVAL if the property does
697 * not exist or its length does not match a multiple of u16 and -ENODATA if the
698 * property does not have a value.
700 static inline int of_property_count_u16_elems(const struct device_node *np,
701 const char *propname)
703 return of_property_count_elems_of_size(np, propname, sizeof(u16));
707 * of_property_count_u32_elems - Count the number of u32 elements in a property
709 * @np: device node from which the property value is to be read.
710 * @propname: name of the property to be searched.
712 * Search for a property in a device node and count the number of u32 elements
713 * in it. Returns number of elements on sucess, -EINVAL if the property does
714 * not exist or its length does not match a multiple of u32 and -ENODATA if the
715 * property does not have a value.
717 static inline int of_property_count_u32_elems(const struct device_node *np,
718 const char *propname)
720 return of_property_count_elems_of_size(np, propname, sizeof(u32));
724 * of_property_count_u64_elems - Count the number of u64 elements in a property
726 * @np: device node from which the property value is to be read.
727 * @propname: name of the property to be searched.
729 * Search for a property in a device node and count the number of u64 elements
730 * in it. Returns number of elements on sucess, -EINVAL if the property does
731 * not exist or its length does not match a multiple of u64 and -ENODATA if the
732 * property does not have a value.
734 static inline int of_property_count_u64_elems(const struct device_node *np,
735 const char *propname)
737 return of_property_count_elems_of_size(np, propname, sizeof(u64));
741 * of_property_read_bool - Findfrom a property
742 * @np: device node from which the property value is to be read.
743 * @propname: name of the property to be searched.
745 * Search for a property in a device node.
746 * Returns true if the property exist false otherwise.
748 static inline bool of_property_read_bool(const struct device_node *np,
749 const char *propname)
751 struct property *prop = of_find_property(np, propname, NULL);
753 return prop ? true : false;
756 static inline int of_property_read_u8(const struct device_node *np,
757 const char *propname,
760 return of_property_read_u8_array(np, propname, out_value, 1);
763 static inline int of_property_read_u16(const struct device_node *np,
764 const char *propname,
767 return of_property_read_u16_array(np, propname, out_value, 1);
770 static inline int of_property_read_u32(const struct device_node *np,
771 const char *propname,
774 return of_property_read_u32_array(np, propname, out_value, 1);
778 * struct of_changeset_entry - Holds a changeset entry
780 * @node: list_head for the log list
781 * @action: notifier action
782 * @np: pointer to the device node affected
783 * @prop: pointer to the property affected
784 * @old_prop: hold a pointer to the original property
786 * Every modification of the device tree during a changeset
787 * is held in a list of of_changeset_entry structures.
788 * That way we can recover from a partial application, or we can
789 * revert the changeset
791 struct of_changeset_entry {
792 struct list_head node;
793 unsigned long action;
794 struct device_node *np;
795 struct property *prop;
796 struct property *old_prop;
800 * struct of_changeset - changeset tracker structure
802 * @entries: list_head for the changeset entries
804 * changesets are a convenient way to apply bulk changes to the
805 * live tree. In case of an error, changes are rolled-back.
806 * changesets live on after initial application, and if not
807 * destroyed after use, they can be reverted in one single call.
809 struct of_changeset {
810 struct list_head entries;
813 enum of_reconfig_change {
814 OF_RECONFIG_NO_CHANGE = 0,
815 OF_RECONFIG_CHANGE_ADD,
816 OF_RECONFIG_CHANGE_REMOVE,
819 #ifdef CONFIG_OF_DYNAMIC
820 extern int of_reconfig_notifier_register(struct notifier_block *);
821 extern int of_reconfig_notifier_unregister(struct notifier_block *);
822 extern int of_reconfig_notify(unsigned long, struct of_reconfig_data *rd);
823 extern int of_reconfig_get_state_change(unsigned long action,
824 struct of_reconfig_data *arg);
826 extern void of_changeset_init(struct of_changeset *ocs);
827 extern void of_changeset_destroy(struct of_changeset *ocs);
828 extern int of_changeset_apply(struct of_changeset *ocs);
829 extern int of_changeset_revert(struct of_changeset *ocs);
830 extern int of_changeset_action(struct of_changeset *ocs,
831 unsigned long action, struct device_node *np,
832 struct property *prop);
834 static inline int of_changeset_attach_node(struct of_changeset *ocs,
835 struct device_node *np)
837 return of_changeset_action(ocs, OF_RECONFIG_ATTACH_NODE, np, NULL);
840 static inline int of_changeset_detach_node(struct of_changeset *ocs,
841 struct device_node *np)
843 return of_changeset_action(ocs, OF_RECONFIG_DETACH_NODE, np, NULL);
846 static inline int of_changeset_add_property(struct of_changeset *ocs,
847 struct device_node *np, struct property *prop)
849 return of_changeset_action(ocs, OF_RECONFIG_ADD_PROPERTY, np, prop);
852 static inline int of_changeset_remove_property(struct of_changeset *ocs,
853 struct device_node *np, struct property *prop)
855 return of_changeset_action(ocs, OF_RECONFIG_REMOVE_PROPERTY, np, prop);
858 static inline int of_changeset_update_property(struct of_changeset *ocs,
859 struct device_node *np, struct property *prop)
861 return of_changeset_action(ocs, OF_RECONFIG_UPDATE_PROPERTY, np, prop);
863 #else /* CONFIG_OF_DYNAMIC */
864 static inline int of_reconfig_notifier_register(struct notifier_block *nb)
868 static inline int of_reconfig_notifier_unregister(struct notifier_block *nb)
872 static inline int of_reconfig_notify(unsigned long action,
873 struct of_reconfig_data *arg)
877 static inline int of_reconfig_get_state_change(unsigned long action,
878 struct of_reconfig_data *arg)
882 #endif /* CONFIG_OF_DYNAMIC */
884 /* CONFIG_OF_RESOLVE api */
885 extern int of_resolve_phandles(struct device_node *tree);
891 #ifdef CONFIG_OF_OVERLAY
893 /* ID based overlays; the API for external users */
894 int of_overlay_create(struct device_node *tree);
895 int of_overlay_destroy(int id);
896 int of_overlay_destroy_all(void);
900 static inline int of_overlay_create(struct device_node *tree)
905 static inline int of_overlay_destroy(int id)
910 static inline int of_overlay_destroy_all(void)
917 #endif /* _LINUX_OF_H */