[PATCH 1/2] powerpc: move ppc_init() to common place

Kevin Hao haokexin at gmail.com
Thu Oct 16 22:18:40 AEDT 2014


So they can be used by ppc64 board. Also remove the unneeded {} to
make checkpatch happy.

Signed-off-by: Kevin Hao <haokexin at gmail.com>
---
 arch/powerpc/include/asm/machdep.h |  2 +-
 arch/powerpc/kernel/setup-common.c | 15 +++++++++++++++
 arch/powerpc/kernel/setup_32.c     | 15 ---------------
 3 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/arch/powerpc/include/asm/machdep.h b/arch/powerpc/include/asm/machdep.h
index 307347f8ddbd..4b913d53333b 100644
--- a/arch/powerpc/include/asm/machdep.h
+++ b/arch/powerpc/include/asm/machdep.h
@@ -213,11 +213,11 @@ struct machdep_calls {
 	int		(*set_dawr)(unsigned long dawr,
 				    unsigned long dawrx);
 
-#ifdef CONFIG_PPC32	/* XXX for now */
 	/* A general init function, called by ppc_init in init/main.c.
 	   May be NULL. */
 	void		(*init)(void);
 
+#ifdef CONFIG_PPC32	/* XXX for now */
 	void		(*kgdb_map_scc)(void);
 
 	/*
diff --git a/arch/powerpc/kernel/setup-common.c b/arch/powerpc/kernel/setup-common.c
index 1362cd62b3fa..f76d4a1dbe73 100644
--- a/arch/powerpc/kernel/setup-common.c
+++ b/arch/powerpc/kernel/setup-common.c
@@ -750,3 +750,18 @@ void arch_setup_pdev_archdata(struct platform_device *pdev)
 	pdev->dev.dma_mask = &pdev->archdata.dma_mask;
  	set_dma_ops(&pdev->dev, &dma_direct_ops);
 }
+
+int __init ppc_init(void)
+{
+	/* clear the progress line */
+	if (ppc_md.progress)
+		ppc_md.progress("             ", 0xffff);
+
+	/* call platform init */
+	if (ppc_md.init != NULL)
+		ppc_md.init();
+
+	return 0;
+}
+
+arch_initcall(ppc_init);
diff --git a/arch/powerpc/kernel/setup_32.c b/arch/powerpc/kernel/setup_32.c
index 07831ed0d9ef..59d8c6e15782 100644
--- a/arch/powerpc/kernel/setup_32.c
+++ b/arch/powerpc/kernel/setup_32.c
@@ -208,21 +208,6 @@ EXPORT_SYMBOL(nvram_sync);
 
 #endif /* CONFIG_NVRAM */
 
-int __init ppc_init(void)
-{
-	/* clear the progress line */
-	if (ppc_md.progress)
-		ppc_md.progress("             ", 0xffff);
-
-	/* call platform init */
-	if (ppc_md.init != NULL) {
-		ppc_md.init();
-	}
-	return 0;
-}
-
-arch_initcall(ppc_init);
-
 static void __init irqstack_early_init(void)
 {
 	unsigned int i;
-- 
1.9.3



More information about the Linuxppc-dev mailing list