diff options
Diffstat (limited to 'include/linux/of.h')
| -rw-r--r-- | include/linux/of.h | 42 | 
1 files changed, 36 insertions, 6 deletions
diff --git a/include/linux/of.h b/include/linux/of.h index 2ec1083af7ff..5919ee33f2b7 100644 --- a/include/linux/of.h +++ b/include/linux/of.h @@ -21,6 +21,7 @@  #include <linux/kref.h>  #include <linux/mod_devicetable.h>  #include <linux/spinlock.h> +#include <linux/topology.h>  #include <asm/byteorder.h>  #include <asm/errno.h> @@ -158,10 +159,10 @@ static inline unsigned long of_read_ulong(const __be32 *cell, int size)  #define OF_BAD_ADDR	((u64)-1) -#ifndef of_node_to_nid -static inline int of_node_to_nid(struct device_node *np) { return -1; } -#define of_node_to_nid of_node_to_nid -#endif +static inline const char* of_node_full_name(struct device_node *np) +{ +	return np ? np->full_name : "<no-node>"; +}  extern struct device_node *of_find_node_by_name(struct device_node *from,  	const char *name); @@ -260,8 +261,7 @@ extern int of_machine_is_compatible(const char *compat);  extern int prom_add_property(struct device_node* np, struct property* prop);  extern int prom_remove_property(struct device_node *np, struct property *prop);  extern int prom_update_property(struct device_node *np, -				struct property *newprop, -				struct property *oldprop); +				struct property *newprop);  #if defined(CONFIG_OF_DYNAMIC)  /* For updating the device tree at runtime */ @@ -303,6 +303,11 @@ const char *of_prop_next_string(struct property *prop, const char *cur);  #else /* CONFIG_OF */ +static inline const char* of_node_full_name(struct device_node *np) +{ +	return "<no-node>"; +} +  static inline bool of_have_populated_dt(void)  {  	return false; @@ -377,6 +382,13 @@ static inline int of_property_read_u64(const struct device_node *np,  	return -ENOSYS;  } +static inline int of_property_match_string(struct device_node *np, +					   const char *propname, +					   const char *string) +{ +	return -ENOSYS; +} +  static inline struct device_node *of_parse_phandle(struct device_node *np,  						   const char *phandle_name,  						   int index) @@ -384,6 +396,15 @@ static inline struct device_node *of_parse_phandle(struct device_node *np,  	return NULL;  } +static inline int of_parse_phandle_with_args(struct device_node *np, +					     const char *list_name, +					     const char *cells_name, +					     int index, +					     struct of_phandle_args *out_args) +{ +	return -ENOSYS; +} +  static inline int of_alias_get_id(struct device_node *np, const char *stem)  {  	return -ENOSYS; @@ -402,6 +423,15 @@ static inline int of_machine_is_compatible(const char *compat)  	while (0)  #endif /* CONFIG_OF */ +#ifndef of_node_to_nid +static inline int of_node_to_nid(struct device_node *np) +{ +	return numa_node_id(); +} + +#define of_node_to_nid of_node_to_nid +#endif +  /**   * of_property_read_bool - Findfrom a property   * @np:		device node from which the property value is to be read.  | 
