]> git.baikalelectronics.ru Git - kernel.git/commitdiff
m68knommu: qspi declutter.
authorSteven King <sfking@fdwdc.com>
Wed, 14 May 2014 17:07:55 +0000 (10:07 -0700)
committerGreg Ungerer <gerg@uclinux.org>
Mon, 26 May 2014 03:28:37 +0000 (13:28 +1000)
Move the check for the QSPI config option inside the function body.  If the
option is not enabled, the compiler will optimize away the empty function
body so we can remove the other check for the config option.

Signed-off-by: Steven King <sfking@fdwdc.com>
Signed-off-by: Greg Ungerer <gerg@uclinux.org>
arch/m68k/platform/coldfire/m520x.c
arch/m68k/platform/coldfire/m523x.c
arch/m68k/platform/coldfire/m5249.c
arch/m68k/platform/coldfire/m527x.c
arch/m68k/platform/coldfire/m528x.c
arch/m68k/platform/coldfire/m53xx.c

index ea1be0e98ad61de3e2a04c6539590184b6c0a43d..4040a3c93733272465a015b1a1fff422983972f7 100644 (file)
@@ -118,10 +118,9 @@ static void __init m520x_clk_init(void)
 
 /***************************************************************************/
 
-#if IS_ENABLED(CONFIG_SPI_COLDFIRE_QSPI)
-
 static void __init m520x_qspi_init(void)
 {
+#if IS_ENABLED(CONFIG_SPI_COLDFIRE_QSPI)
        u16 par;
        /* setup Port QS for QSPI with gpio CS control */
        writeb(0x3f, MCF_GPIO_PAR_QSPI);
@@ -129,9 +128,8 @@ static void __init m520x_qspi_init(void)
        par = readw(MCF_GPIO_PAR_UART);
        par &= 0x00ff;
        writew(par, MCF_GPIO_PAR_UART);
-}
-
 #endif /* IS_ENABLED(CONFIG_SPI_COLDFIRE_QSPI) */
+}
 
 /***************************************************************************/
 
@@ -176,9 +174,7 @@ void __init config_BSP(char *commandp, int size)
        m520x_clk_init();
        m520x_uarts_init();
        m520x_fec_init();
-#if IS_ENABLED(CONFIG_SPI_COLDFIRE_QSPI)
        m520x_qspi_init();
-#endif
 }
 
 /***************************************************************************/
index bef0ef364d5e42a58e5eb8bdd4252a92e76c1b56..6b7135e6d5b42ffa08411becd33b7c451ce305aa 100644 (file)
@@ -52,10 +52,9 @@ struct clk *mcf_clks[] = {
 
 /***************************************************************************/
 
-#if IS_ENABLED(CONFIG_SPI_COLDFIRE_QSPI)
-
 static void __init m523x_qspi_init(void)
 {
+#if IS_ENABLED(CONFIG_SPI_COLDFIRE_QSPI)
        u16 par;
 
        /* setup QSPS pins for QSPI with gpio CS control */
@@ -64,9 +63,8 @@ static void __init m523x_qspi_init(void)
        par = readw(MCFGPIO_PAR_TIMER);
        par &= 0x3f3f;
        writew(par, MCFGPIO_PAR_TIMER);
-}
-
 #endif /* IS_ENABLED(CONFIG_SPI_COLDFIRE_QSPI) */
+}
 
 /***************************************************************************/
 
@@ -82,9 +80,7 @@ void __init config_BSP(char *commandp, int size)
 {
        mach_sched_init = hw_timer_init;
        m523x_fec_init();
-#if IS_ENABLED(CONFIG_SPI_COLDFIRE_QSPI)
        m523x_qspi_init();
-#endif
 }
 
 /***************************************************************************/
index 405ff3ca4f4fcff64585e703ea9d85e91a6e7d7c..f6253a3313b3861681308c41f3a069c882ceb7f8 100644 (file)
@@ -73,17 +73,15 @@ static struct platform_device *m5249_devices[] __initdata = {
 
 /***************************************************************************/
 
-#if IS_ENABLED(CONFIG_SPI_COLDFIRE_QSPI)
-
 static void __init m5249_qspi_init(void)
 {
+#if IS_ENABLED(CONFIG_SPI_COLDFIRE_QSPI)
        /* QSPI irq setup */
        writeb(MCFSIM_ICR_AUTOVEC | MCFSIM_ICR_LEVEL4 | MCFSIM_ICR_PRI0,
               MCFSIM_QSPIICR);
        mcf_mapirq2imr(MCF_IRQ_QSPI, MCFINTC_QSPI);
-}
-
 #endif /* IS_ENABLED(CONFIG_SPI_COLDFIRE_QSPI) */
+}
 
 /***************************************************************************/
 
@@ -112,9 +110,7 @@ void __init config_BSP(char *commandp, int size)
 #ifdef CONFIG_M5249C3
        m5249_smc91x_init();
 #endif
-#if IS_ENABLED(CONFIG_SPI_COLDFIRE_QSPI)
        m5249_qspi_init();
-#endif
 }
 
 /***************************************************************************/
index 782e620460b194835615e2f4c0700929c7db459e..62d81ef016f1742081b35d2ce534a9b2eabcfa09 100644 (file)
@@ -55,10 +55,9 @@ struct clk *mcf_clks[] = {
 
 /***************************************************************************/
 
-#if IS_ENABLED(CONFIG_SPI_COLDFIRE_QSPI)
-
 static void __init m527x_qspi_init(void)
 {
+#if IS_ENABLED(CONFIG_SPI_COLDFIRE_QSPI)
 #if defined(CONFIG_M5271)
        u16 par;
 
@@ -72,9 +71,8 @@ static void __init m527x_qspi_init(void)
        /* setup QSPS pins for QSPI with gpio CS control */
        writew(0x003e, MCFGPIO_PAR_QSPI);
 #endif
-}
-
 #endif /* IS_ENABLED(CONFIG_SPI_COLDFIRE_QSPI) */
+}
 
 /***************************************************************************/
 
@@ -122,9 +120,7 @@ void __init config_BSP(char *commandp, int size)
        mach_sched_init = hw_timer_init;
        m527x_uarts_init();
        m527x_fec_init();
-#if IS_ENABLED(CONFIG_SPI_COLDFIRE_QSPI)
        m527x_qspi_init();
-#endif
 }
 
 /***************************************************************************/
index d8348c9a42fa05905ecdd460ea3b6ec7a3e924e3..21cd161d36f19d570a693bb6d315d56846416f6d 100644 (file)
@@ -54,15 +54,13 @@ struct clk *mcf_clks[] = {
 
 /***************************************************************************/
 
-#if IS_ENABLED(CONFIG_SPI_COLDFIRE_QSPI)
-
 static void __init m528x_qspi_init(void)
 {
+#if IS_ENABLED(CONFIG_SPI_COLDFIRE_QSPI)
        /* setup Port QS for QSPI with gpio CS control */
        __raw_writeb(0x07, MCFGPIO_PQSPAR);
-}
-
 #endif /* IS_ENABLED(CONFIG_SPI_COLDFIRE_QSPI) */
+}
 
 /***************************************************************************/
 
@@ -128,9 +126,7 @@ void __init config_BSP(char *commandp, int size)
        mach_sched_init = hw_timer_init;
        m528x_uarts_init();
        m528x_fec_init();
-#if IS_ENABLED(CONFIG_SPI_COLDFIRE_QSPI)
        m528x_qspi_init();
-#endif
 }
 
 /***************************************************************************/
index 5286f98fbed075cbe73298c02bd6b568beb332c2..80879a7fe3d511f7b8d54e12e2206a0ed0e2c3c3 100644 (file)
@@ -166,15 +166,13 @@ static void __init m53xx_clk_init(void)
 
 /***************************************************************************/
 
-#if IS_ENABLED(CONFIG_SPI_COLDFIRE_QSPI)
-
 static void __init m53xx_qspi_init(void)
 {
+#if IS_ENABLED(CONFIG_SPI_COLDFIRE_QSPI)
        /* setup QSPS pins for QSPI with gpio CS control */
        writew(0x01f0, MCFGPIO_PAR_QSPI);
-}
-
 #endif /* IS_ENABLED(CONFIG_SPI_COLDFIRE_QSPI) */
+}
 
 /***************************************************************************/
 
@@ -219,9 +217,7 @@ void __init config_BSP(char *commandp, int size)
        m53xx_clk_init();
        m53xx_uarts_init();
        m53xx_fec_init();
-#if IS_ENABLED(CONFIG_SPI_COLDFIRE_QSPI)
        m53xx_qspi_init();
-#endif
 
 #ifdef CONFIG_BDM_DISABLE
        /*