From 391b459d7623b26153c7d8c200e8d213440a7d48 Mon Sep 17 00:00:00 2001 From: Pantelis Antoniou Date: Fri, 24 Apr 2015 12:41:56 +0300 Subject: of: Move OF flags to be visible even when !CONFIG_OF We need those to be visible even when compiling with CONFIG_OF disabled, since even the empty of_node_*_flag() method use the flag. Signed-off-by: Pantelis Antoniou Acked-by: Wolfram Sang Signed-off-by: Rob Herring --- include/linux/of.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'include/linux/of.h') diff --git a/include/linux/of.h b/include/linux/of.h index ddeaae6d2083..9b32cbdf0230 100644 --- a/include/linux/of.h +++ b/include/linux/of.h @@ -120,6 +120,12 @@ extern struct device_node *of_aliases; extern struct device_node *of_stdout; extern raw_spinlock_t devtree_lock; +/* flag descriptions (need to be visible even when !CONFIG_OF) */ +#define OF_DYNAMIC 1 /* node and properties were allocated via kmalloc */ +#define OF_DETACHED 2 /* node has been detached from the device tree */ +#define OF_POPULATED 3 /* device already created for the node */ +#define OF_POPULATED_BUS 4 /* of_platform_populate recursed to children of this node */ + #ifdef CONFIG_OF static inline bool is_of_node(struct fwnode_handle *fwnode) { @@ -217,12 +223,6 @@ static inline unsigned long of_read_ulong(const __be32 *cell, int size) #define of_node_cmp(s1, s2) strcasecmp((s1), (s2)) #endif -/* flag descriptions */ -#define OF_DYNAMIC 1 /* node and properties were allocated via kmalloc */ -#define OF_DETACHED 2 /* node has been detached from the device tree */ -#define OF_POPULATED 3 /* device already created for the node */ -#define OF_POPULATED_BUS 4 /* of_platform_populate recursed to children of this node */ - #define OF_IS_DYNAMIC(x) test_bit(OF_DYNAMIC, &x->_flags) #define OF_MARK_DYNAMIC(x) set_bit(OF_DYNAMIC, &x->_flags) -- cgit v1.2.3-70-g09d2 From 31712c98f8180c7bd3f33eefa461f0e1142e18f5 Mon Sep 17 00:00:00 2001 From: Geert Uytterhoeven Date: Mon, 4 May 2015 19:42:19 +0200 Subject: of: Grammar s/property exist/property exists/ Signed-off-by: Geert Uytterhoeven Signed-off-by: Rob Herring --- include/linux/of.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/linux/of.h') diff --git a/include/linux/of.h b/include/linux/of.h index 9b32cbdf0230..a3eb9d1e5800 100644 --- a/include/linux/of.h +++ b/include/linux/of.h @@ -815,7 +815,7 @@ static inline int of_property_read_string_index(struct device_node *np, * @propname: name of the property to be searched. * * Search for a property in a device node. - * Returns true if the property exist false otherwise. + * Returns true if the property exists false otherwise. */ static inline bool of_property_read_bool(const struct device_node *np, const char *propname) -- cgit v1.2.3-70-g09d2 From c8fff7bc5bba6bd59cad40441c189c4efe7190f6 Mon Sep 17 00:00:00 2001 From: Konstantin Khlebnikov Date: Wed, 8 Apr 2015 19:59:20 +0300 Subject: of: return NUMA_NO_NODE from fallback of_node_to_nid() Node 0 might be offline as well as any other numa node, in this case kernel cannot handle memory allocation and crashes. Signed-off-by: Konstantin Khlebnikov Fixes: 0c3f061c195c ("of: implement of_node_to_nid as a weak function") Signed-off-by: Grant Likely --- drivers/of/base.c | 2 +- include/linux/of.h | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) (limited to 'include/linux/of.h') diff --git a/drivers/of/base.c b/drivers/of/base.c index 99764db0875a..8e39b38ca206 100644 --- a/drivers/of/base.c +++ b/drivers/of/base.c @@ -89,7 +89,7 @@ EXPORT_SYMBOL(of_n_size_cells); #ifdef CONFIG_NUMA int __weak of_node_to_nid(struct device_node *np) { - return numa_node_id(); + return NUMA_NO_NODE; } #endif diff --git a/include/linux/of.h b/include/linux/of.h index ddeaae6d2083..ab071742c0c4 100644 --- a/include/linux/of.h +++ b/include/linux/of.h @@ -667,7 +667,10 @@ static inline void of_property_clear_flag(struct property *p, unsigned long flag #if defined(CONFIG_OF) && defined(CONFIG_NUMA) extern int of_node_to_nid(struct device_node *np); #else -static inline int of_node_to_nid(struct device_node *device) { return 0; } +static inline int of_node_to_nid(struct device_node *device) +{ + return NUMA_NO_NODE; +} #endif static inline struct device_node *of_find_matching_node( -- cgit v1.2.3-70-g09d2 From ce16b9d2356125eb791bd920c710b8512eecce54 Mon Sep 17 00:00:00 2001 From: Suman Anna Date: Wed, 17 Jun 2015 11:53:53 -0500 Subject: of: define of_find_node_by_phandle for !CONFIG_OF Define stub implementation for of_find_node_by_phandle() API so that users of this API can build properly even when CONFIG_OF is not defined. Fixes x86 randconfig build failure of remoteproc. Signed-off-by: Suman Anna [robh: add details on fixing remoteproc compile] Signed-off-by: Rob Herring --- include/linux/of.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'include/linux/of.h') diff --git a/include/linux/of.h b/include/linux/of.h index a3eb9d1e5800..54f858798e8c 100644 --- a/include/linux/of.h +++ b/include/linux/of.h @@ -422,6 +422,11 @@ static inline struct device_node *of_find_node_opts_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; -- cgit v1.2.3-70-g09d2