--- zzzz-none-000/linux-2.6.39.4/include/linux/of.h 2011-08-03 19:43:28.000000000 +0000 +++ puma6-atom-6490-729/linux-2.6.39.4/include/linux/of.h 2021-11-10 13:38:17.000000000 +0000 @@ -63,13 +63,13 @@ #endif }; -#ifdef CONFIG_OF /* Pointer for first entry in chain of all nodes. */ extern struct device_node *allnodes; extern struct device_node *of_chosen; extern rwlock_t devtree_lock; +#ifdef CONFIG_OF static inline bool of_have_populated_dt(void) { return allnodes != NULL; @@ -152,7 +152,7 @@ #define OF_BAD_ADDR ((u64)-1) #ifndef of_node_to_nid -static inline int of_node_to_nid(struct device_node *np) { return -1; } +static inline int of_node_to_nid(struct device_node *np __attribute__((unused))) { return -1; } #define of_node_to_nid of_node_to_nid #endif @@ -195,6 +195,10 @@ extern struct property *of_find_property(const struct device_node *np, const char *name, int *lenp); +extern int of_property_read_u32(struct device_node *np, char *propname, + u32 *out_value); +extern int of_property_read_string(struct device_node *np, char *propname, + const char **out_string); extern int of_device_is_compatible(const struct device_node *device, const char *); extern int of_device_is_available(const struct device_node *device); @@ -227,12 +231,124 @@ extern void of_detach_node(struct device_node *); #endif -#else +#else /* CONFIG_OF */ + +static inline struct device_node *of_find_node_by_name(struct device_node *from, + const char *name) +{ + return NULL; +} + +static inline struct device_node *of_find_node_by_type(struct device_node *from, + const char *type) +{ + return NULL; +} + +static inline struct device_node *of_find_node_by_path(const char *path) +{ + return NULL; +} + +static inline struct device_node *of_find_node_by_phandle(phandle handle) +{ + return NULL; +} + +static inline struct device_node *of_get_parent(const struct device_node *node) +{ + return NULL; +} + +static inline struct device_node *of_get_next_child( + const struct device_node *node, struct device_node *prev) +{ + return NULL; +} + +static inline struct device_node *of_find_node_with_property( + struct device_node *from, const char *prop_name) +{ + return NULL; +} static inline bool of_have_populated_dt(void) { return false; } +static inline int of_device_is_compatible(const struct device_node *device, + const char *name) +{ + return 0; +} + +static inline bool of_device_is_available(const struct device_node *device) +{ + return false; +} + +static inline struct property *of_find_property(const struct device_node *np, + const char *name, + int *lenp) +{ + return NULL; +} + +static inline struct device_node *of_find_compatible_node( + struct device_node *from, + const char *type, + const char *compat) +{ + return NULL; +} + +static inline const void *of_get_property(const struct device_node *node, + const char *name, + int *lenp) +{ + return NULL; +} + +static inline int of_n_addr_cells(struct device_node *np) +{ + return 0; + +} +static inline int of_n_size_cells(struct device_node *np) +{ + return 0; +} + +static inline int of_property_read_string(const struct device_node *np, + const char *propname, + const char **out_string) +{ + return -ENOSYS; +} + +static inline struct device_node *of_parse_phandle(const struct device_node *np, + const char *phandle_name, + int index) +{ + return NULL; +} + +static inline int of_machine_is_compatible(const char *compat) +{ + return 0; +} + +static inline int of_node_check_flag(struct device_node *n, unsigned long flag) +{ + return 0; +} + +static inline void of_node_set_flag(struct device_node *n, unsigned long flag) +{ +} + +#define of_match_ptr(_ptr) NULL +#define of_match_node(_matches, _node) NULL #endif /* CONFIG_OF */ #endif /* _LINUX_OF_H */