[PATCH 4/4] Move of_node[attach, detach] declarations to linux/of.h
Andres Salomon
dilinger at collabora.co.uk
Thu Nov 19 16:35:17 EST 2009
On Wed, 18 Nov 2009 15:48:02 -0600
Nathan Fontenot <nfont at austin.ibm.com> wrote:
> Merge the declarations of of_attach_node and of_detach_node from the
> asm/prom.h headers of powerpc and microblaze into linux/of.h.
>
> This update also requires adding linux/of.h to the include list for
> powerpc/platforms/pseries/reconfig.h.
>
> Updated patch that should apply cleanly to test-devicetree, now with
> diffstat output.
>
> Signed-off-by: Nathan Fontenot
> <nfont at austin.ibm.com> ---
> arch/microblaze/include/asm/prom.h | 4 ----
> arch/powerpc/include/asm/prom.h | 4 ----
> arch/powerpc/platforms/pseries/reconfig.c | 1 +
> include/linux/of.h | 6 ++++++
> 4 files changed, 7 insertions(+), 8 deletions(-)
>
> Index: test-devicetree/arch/microblaze/include/asm/prom.h
> ===================================================================
> --- test-devicetree.orig/arch/microblaze/include/asm/prom.h
> 2009-11-18 17:34:36.000000000 -0600 +++
> test-devicetree/arch/microblaze/include/asm/prom.h 2009-11-18
> 19:26:53.000000000 -0600 @@ -39,10 +39,6 @@
> extern rwlock_t devtree_lock; /* temporary while merging */
>
> -/* For updating the device tree at runtime */
> -extern void of_attach_node(struct device_node *);
> -extern void of_detach_node(struct device_node *);
> -
Minor points, but I'd recommend moving the declarations at the same
time as the definitions. That is, move the of_attach_node declaration
in patch1 and of_detach_node declaration in patch2.
> /* Other Prototypes */
> extern int early_uartlite_console(void);
>
> Index: test-devicetree/arch/powerpc/include/asm/prom.h
> ===================================================================
> --- test-devicetree.orig/arch/powerpc/include/asm/prom.h
> 2009-11-18 17:34:36.000000000 -0600 +++
> test-devicetree/arch/powerpc/include/asm/prom.h 2009-11-18
> 19:27:32.000000000 -0600 @@ -34,10 +34,6 @@
> #define HAVE_ARCH_DEVTREE_FIXUPS
>
> -/* For updating the device tree at runtime */
> -extern void of_attach_node(struct device_node *);
> -extern void of_detach_node(struct device_node *);
> -
> #ifdef CONFIG_PPC32
> /*
> * PCI <-> OF matching functions
> Index: test-devicetree/arch/powerpc/platforms/pseries/reconfig.c
> ===================================================================
> ---
> test-devicetree.orig/arch/powerpc/platforms/pseries/reconfig.c
> 2009-11-18 17:23:40.000000000 -0600 +++
> test-devicetree/arch/powerpc/platforms/pseries/reconfig.c
> 2009-11-18 19:26:53.000000000 -0600 @@ -15,6 +15,7 @@ #include
> <linux/kref.h> #include <linux/notifier.h> #include <linux/proc_fs.h>
> +#include <linux/of.h>
>
> #include <asm/prom.h>
> #include <asm/machdep.h>
> Index: test-devicetree/include/linux/of.h
> ===================================================================
> --- test-devicetree.orig/include/linux/of.h 2009-11-18
> 17:34:36.000000000 -0600 +++
> test-devicetree/include/linux/of.h 2009-11-18
> 19:26:53.000000000 -0600 @@ -187,4 +187,10 @@ const char *list_name,
> const char *cells_name, int index, struct device_node **out_node,
> const void **out_args);
> +#ifdef CONFIG_OF_DYNAMIC
> +/* For updating the device tree at runtime */
> +extern void of_attach_node(struct device_node *);
> +extern void of_detach_node(struct device_node *);
> +#endif
> +
> #endif /* _LINUX_OF_H */
The trend seems to be a different header file per config option.
"of_dynamic.h" would be the logic extension of that..
More information about the devicetree-discuss
mailing list