Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

of: Make devtree_lock declaration private

Sparc is the only place devtree_lock is used outside of drivers/of/.
Move the devtree_lock declaration into of_private.h and Sparc's prom.h
so pulling in spinlock.h to of.h can be avoided for everything besides
Sparc.

Link: https://lore.kernel.org/r/20230329-dt-cpu-header-cleanups-v1-1-581e2605fe47@kernel.org
Signed-off-by: Rob Herring <robh@kernel.org>

+4 -2
+3
arch/sparc/include/asm/prom.h
··· 19 19 #include <linux/mutex.h> 20 20 #include <linux/atomic.h> 21 21 #include <linux/irqdomain.h> 22 + #include <linux/spinlock.h> 22 23 23 24 #define of_compat_cmp(s1, s2, l) strncmp((s1), (s2), (l)) 24 25 #define of_prop_cmp(s1, s2) strcasecmp((s1), (s2)) 25 26 #define of_node_cmp(s1, s2) strcmp((s1), (s2)) 27 + 28 + extern raw_spinlock_t devtree_lock; 26 29 27 30 struct of_irq_controller { 28 31 unsigned int (*irq_build)(struct device_node *, unsigned int, void *);
+1
drivers/of/of_private.h
··· 38 38 #define OF_ROOT_NODE_SIZE_CELLS_DEFAULT 1 39 39 40 40 extern struct mutex of_mutex; 41 + extern raw_spinlock_t devtree_lock; 41 42 extern struct list_head aliases_lookup; 42 43 extern struct kset *of_kset; 43 44
-2
include/linux/of.h
··· 16 16 #include <linux/errno.h> 17 17 #include <linux/kobject.h> 18 18 #include <linux/mod_devicetable.h> 19 - #include <linux/spinlock.h> 20 19 #include <linux/topology.h> 21 20 #include <linux/notifier.h> 22 21 #include <linux/property.h> ··· 144 145 extern struct device_node *of_chosen; 145 146 extern struct device_node *of_aliases; 146 147 extern struct device_node *of_stdout; 147 - extern raw_spinlock_t devtree_lock; 148 148 149 149 /* 150 150 * struct device_node flag descriptions