aboutsummaryrefslogtreecommitdiffstats
path: root/arch/m68k
diff options
context:
space:
mode:
authorSteven King <sfking@fdwdc.com>2014-05-14 13:07:55 -0400
committerGreg Ungerer <gerg@uclinux.org>2014-05-25 23:28:37 -0400
commit151d14f4ac5a02cc059cb05b2a2f27ec5b9d6831 (patch)
tree07b6a7e045ccef506f6034677aeecb23eb28a88f /arch/m68k
parente93e91f2255fce33727d5f618cb16885fd157291 (diff)
m68knommu: qspi declutter.
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>
Diffstat (limited to 'arch/m68k')
-rw-r--r--arch/m68k/platform/coldfire/m520x.c8
-rw-r--r--arch/m68k/platform/coldfire/m523x.c8
-rw-r--r--arch/m68k/platform/coldfire/m5249.c8
-rw-r--r--arch/m68k/platform/coldfire/m527x.c8
-rw-r--r--arch/m68k/platform/coldfire/m528x.c8
-rw-r--r--arch/m68k/platform/coldfire/m53xx.c8
6 files changed, 12 insertions, 36 deletions
diff --git a/arch/m68k/platform/coldfire/m520x.c b/arch/m68k/platform/coldfire/m520x.c
index ea1be0e98ad6..4040a3c93733 100644
--- a/arch/m68k/platform/coldfire/m520x.c
+++ b/arch/m68k/platform/coldfire/m520x.c
@@ -118,10 +118,9 @@ static void __init m520x_clk_init(void)
118 118
119/***************************************************************************/ 119/***************************************************************************/
120 120
121#if IS_ENABLED(CONFIG_SPI_COLDFIRE_QSPI)
122
123static void __init m520x_qspi_init(void) 121static void __init m520x_qspi_init(void)
124{ 122{
123#if IS_ENABLED(CONFIG_SPI_COLDFIRE_QSPI)
125 u16 par; 124 u16 par;
126 /* setup Port QS for QSPI with gpio CS control */ 125 /* setup Port QS for QSPI with gpio CS control */
127 writeb(0x3f, MCF_GPIO_PAR_QSPI); 126 writeb(0x3f, MCF_GPIO_PAR_QSPI);
@@ -129,9 +128,8 @@ static void __init m520x_qspi_init(void)
129 par = readw(MCF_GPIO_PAR_UART); 128 par = readw(MCF_GPIO_PAR_UART);
130 par &= 0x00ff; 129 par &= 0x00ff;
131 writew(par, MCF_GPIO_PAR_UART); 130 writew(par, MCF_GPIO_PAR_UART);
132}
133
134#endif /* IS_ENABLED(CONFIG_SPI_COLDFIRE_QSPI) */ 131#endif /* IS_ENABLED(CONFIG_SPI_COLDFIRE_QSPI) */
132}
135 133
136/***************************************************************************/ 134/***************************************************************************/
137 135
@@ -176,9 +174,7 @@ void __init config_BSP(char *commandp, int size)
176 m520x_clk_init(); 174 m520x_clk_init();
177 m520x_uarts_init(); 175 m520x_uarts_init();
178 m520x_fec_init(); 176 m520x_fec_init();
179#if IS_ENABLED(CONFIG_SPI_COLDFIRE_QSPI)
180 m520x_qspi_init(); 177 m520x_qspi_init();
181#endif
182} 178}
183 179
184/***************************************************************************/ 180/***************************************************************************/
diff --git a/arch/m68k/platform/coldfire/m523x.c b/arch/m68k/platform/coldfire/m523x.c
index bef0ef364d5e..6b7135e6d5b4 100644
--- a/arch/m68k/platform/coldfire/m523x.c
+++ b/arch/m68k/platform/coldfire/m523x.c
@@ -52,10 +52,9 @@ struct clk *mcf_clks[] = {
52 52
53/***************************************************************************/ 53/***************************************************************************/
54 54
55#if IS_ENABLED(CONFIG_SPI_COLDFIRE_QSPI)
56
57static void __init m523x_qspi_init(void) 55static void __init m523x_qspi_init(void)
58{ 56{
57#if IS_ENABLED(CONFIG_SPI_COLDFIRE_QSPI)
59 u16 par; 58 u16 par;
60 59
61 /* setup QSPS pins for QSPI with gpio CS control */ 60 /* setup QSPS pins for QSPI with gpio CS control */
@@ -64,9 +63,8 @@ static void __init m523x_qspi_init(void)
64 par = readw(MCFGPIO_PAR_TIMER); 63 par = readw(MCFGPIO_PAR_TIMER);
65 par &= 0x3f3f; 64 par &= 0x3f3f;
66 writew(par, MCFGPIO_PAR_TIMER); 65 writew(par, MCFGPIO_PAR_TIMER);
67}
68
69#endif /* IS_ENABLED(CONFIG_SPI_COLDFIRE_QSPI) */ 66#endif /* IS_ENABLED(CONFIG_SPI_COLDFIRE_QSPI) */
67}
70 68
71/***************************************************************************/ 69/***************************************************************************/
72 70
@@ -82,9 +80,7 @@ void __init config_BSP(char *commandp, int size)
82{ 80{
83 mach_sched_init = hw_timer_init; 81 mach_sched_init = hw_timer_init;
84 m523x_fec_init(); 82 m523x_fec_init();
85#if IS_ENABLED(CONFIG_SPI_COLDFIRE_QSPI)
86 m523x_qspi_init(); 83 m523x_qspi_init();
87#endif
88} 84}
89 85
90/***************************************************************************/ 86/***************************************************************************/
diff --git a/arch/m68k/platform/coldfire/m5249.c b/arch/m68k/platform/coldfire/m5249.c
index 405ff3ca4f4f..f6253a3313b3 100644
--- a/arch/m68k/platform/coldfire/m5249.c
+++ b/arch/m68k/platform/coldfire/m5249.c
@@ -73,17 +73,15 @@ static struct platform_device *m5249_devices[] __initdata = {
73 73
74/***************************************************************************/ 74/***************************************************************************/
75 75
76#if IS_ENABLED(CONFIG_SPI_COLDFIRE_QSPI)
77
78static void __init m5249_qspi_init(void) 76static void __init m5249_qspi_init(void)
79{ 77{
78#if IS_ENABLED(CONFIG_SPI_COLDFIRE_QSPI)
80 /* QSPI irq setup */ 79 /* QSPI irq setup */
81 writeb(MCFSIM_ICR_AUTOVEC | MCFSIM_ICR_LEVEL4 | MCFSIM_ICR_PRI0, 80 writeb(MCFSIM_ICR_AUTOVEC | MCFSIM_ICR_LEVEL4 | MCFSIM_ICR_PRI0,
82 MCFSIM_QSPIICR); 81 MCFSIM_QSPIICR);
83 mcf_mapirq2imr(MCF_IRQ_QSPI, MCFINTC_QSPI); 82 mcf_mapirq2imr(MCF_IRQ_QSPI, MCFINTC_QSPI);
84}
85
86#endif /* IS_ENABLED(CONFIG_SPI_COLDFIRE_QSPI) */ 83#endif /* IS_ENABLED(CONFIG_SPI_COLDFIRE_QSPI) */
84}
87 85
88/***************************************************************************/ 86/***************************************************************************/
89 87
@@ -112,9 +110,7 @@ void __init config_BSP(char *commandp, int size)
112#ifdef CONFIG_M5249C3 110#ifdef CONFIG_M5249C3
113 m5249_smc91x_init(); 111 m5249_smc91x_init();
114#endif 112#endif
115#if IS_ENABLED(CONFIG_SPI_COLDFIRE_QSPI)
116 m5249_qspi_init(); 113 m5249_qspi_init();
117#endif
118} 114}
119 115
120/***************************************************************************/ 116/***************************************************************************/
diff --git a/arch/m68k/platform/coldfire/m527x.c b/arch/m68k/platform/coldfire/m527x.c
index 782e620460b1..62d81ef016f1 100644
--- a/arch/m68k/platform/coldfire/m527x.c
+++ b/arch/m68k/platform/coldfire/m527x.c
@@ -55,10 +55,9 @@ struct clk *mcf_clks[] = {
55 55
56/***************************************************************************/ 56/***************************************************************************/
57 57
58#if IS_ENABLED(CONFIG_SPI_COLDFIRE_QSPI)
59
60static void __init m527x_qspi_init(void) 58static void __init m527x_qspi_init(void)
61{ 59{
60#if IS_ENABLED(CONFIG_SPI_COLDFIRE_QSPI)
62#if defined(CONFIG_M5271) 61#if defined(CONFIG_M5271)
63 u16 par; 62 u16 par;
64 63
@@ -72,9 +71,8 @@ static void __init m527x_qspi_init(void)
72 /* setup QSPS pins for QSPI with gpio CS control */ 71 /* setup QSPS pins for QSPI with gpio CS control */
73 writew(0x003e, MCFGPIO_PAR_QSPI); 72 writew(0x003e, MCFGPIO_PAR_QSPI);
74#endif 73#endif
75}
76
77#endif /* IS_ENABLED(CONFIG_SPI_COLDFIRE_QSPI) */ 74#endif /* IS_ENABLED(CONFIG_SPI_COLDFIRE_QSPI) */
75}
78 76
79/***************************************************************************/ 77/***************************************************************************/
80 78
@@ -122,9 +120,7 @@ void __init config_BSP(char *commandp, int size)
122 mach_sched_init = hw_timer_init; 120 mach_sched_init = hw_timer_init;
123 m527x_uarts_init(); 121 m527x_uarts_init();
124 m527x_fec_init(); 122 m527x_fec_init();
125#if IS_ENABLED(CONFIG_SPI_COLDFIRE_QSPI)
126 m527x_qspi_init(); 123 m527x_qspi_init();
127#endif
128} 124}
129 125
130/***************************************************************************/ 126/***************************************************************************/
diff --git a/arch/m68k/platform/coldfire/m528x.c b/arch/m68k/platform/coldfire/m528x.c
index d8348c9a42fa..21cd161d36f1 100644
--- a/arch/m68k/platform/coldfire/m528x.c
+++ b/arch/m68k/platform/coldfire/m528x.c
@@ -54,15 +54,13 @@ struct clk *mcf_clks[] = {
54 54
55/***************************************************************************/ 55/***************************************************************************/
56 56
57#if IS_ENABLED(CONFIG_SPI_COLDFIRE_QSPI)
58
59static void __init m528x_qspi_init(void) 57static void __init m528x_qspi_init(void)
60{ 58{
59#if IS_ENABLED(CONFIG_SPI_COLDFIRE_QSPI)
61 /* setup Port QS for QSPI with gpio CS control */ 60 /* setup Port QS for QSPI with gpio CS control */
62 __raw_writeb(0x07, MCFGPIO_PQSPAR); 61 __raw_writeb(0x07, MCFGPIO_PQSPAR);
63}
64
65#endif /* IS_ENABLED(CONFIG_SPI_COLDFIRE_QSPI) */ 62#endif /* IS_ENABLED(CONFIG_SPI_COLDFIRE_QSPI) */
63}
66 64
67/***************************************************************************/ 65/***************************************************************************/
68 66
@@ -128,9 +126,7 @@ void __init config_BSP(char *commandp, int size)
128 mach_sched_init = hw_timer_init; 126 mach_sched_init = hw_timer_init;
129 m528x_uarts_init(); 127 m528x_uarts_init();
130 m528x_fec_init(); 128 m528x_fec_init();
131#if IS_ENABLED(CONFIG_SPI_COLDFIRE_QSPI)
132 m528x_qspi_init(); 129 m528x_qspi_init();
133#endif
134} 130}
135 131
136/***************************************************************************/ 132/***************************************************************************/
diff --git a/arch/m68k/platform/coldfire/m53xx.c b/arch/m68k/platform/coldfire/m53xx.c
index 5286f98fbed0..80879a7fe3d5 100644
--- a/arch/m68k/platform/coldfire/m53xx.c
+++ b/arch/m68k/platform/coldfire/m53xx.c
@@ -166,15 +166,13 @@ static void __init m53xx_clk_init(void)
166 166
167/***************************************************************************/ 167/***************************************************************************/
168 168
169#if IS_ENABLED(CONFIG_SPI_COLDFIRE_QSPI)
170
171static void __init m53xx_qspi_init(void) 169static void __init m53xx_qspi_init(void)
172{ 170{
171#if IS_ENABLED(CONFIG_SPI_COLDFIRE_QSPI)
173 /* setup QSPS pins for QSPI with gpio CS control */ 172 /* setup QSPS pins for QSPI with gpio CS control */
174 writew(0x01f0, MCFGPIO_PAR_QSPI); 173 writew(0x01f0, MCFGPIO_PAR_QSPI);
175}
176
177#endif /* IS_ENABLED(CONFIG_SPI_COLDFIRE_QSPI) */ 174#endif /* IS_ENABLED(CONFIG_SPI_COLDFIRE_QSPI) */
175}
178 176
179/***************************************************************************/ 177/***************************************************************************/
180 178
@@ -219,9 +217,7 @@ void __init config_BSP(char *commandp, int size)
219 m53xx_clk_init(); 217 m53xx_clk_init();
220 m53xx_uarts_init(); 218 m53xx_uarts_init();
221 m53xx_fec_init(); 219 m53xx_fec_init();
222#if IS_ENABLED(CONFIG_SPI_COLDFIRE_QSPI)
223 m53xx_qspi_init(); 220 m53xx_qspi_init();
224#endif
225 221
226#ifdef CONFIG_BDM_DISABLE 222#ifdef CONFIG_BDM_DISABLE
227 /* 223 /*