aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2014-03-15 15:08:48 -0400
committerArnd Bergmann <arnd@arndb.de>2014-03-21 13:26:18 -0400
commit4f579c0391320285ac48551efd9715a0e8366379 (patch)
tree270df7b31e91f30995c66a3704275eb69d04205f /arch/arm
parent4ab75a3f3ddb840cc93446ebbcad8838e337d53f (diff)
ARM: s5p64x0: fix building with only one soc type
The s5p64x0 platform supports two distinct SoCs, s5p6440 and s5p6450, and in the normal configuration, both are enabled. However if we build a kernel that only enables one of the two, the #ifdef logic in common.c breaks down, as some of the functions declared in the header are defined to NULL using the preprocessor but then defined anyway. This patch cleans up the mess and ensures that each function has either exactly one C declaration and one matching C definition, or we have a NULL defined function pointer but no C definition. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Acked-by: Kukjin Kim <kgene.kim@samsung.com> Cc: Tomasz Figa <tomasz.figa@gmail.com> Cc: Ben Dooks <ben-linux@fluff.org>
Diffstat (limited to 'arch/arm')
-rw-r--r--arch/arm/mach-s5p64x0/common.c18
-rw-r--r--arch/arm/mach-s5p64x0/common.h5
2 files changed, 17 insertions, 6 deletions
diff --git a/arch/arm/mach-s5p64x0/common.c b/arch/arm/mach-s5p64x0/common.c
index 42e14f2e7ca7..f07edc304efb 100644
--- a/arch/arm/mach-s5p64x0/common.c
+++ b/arch/arm/mach-s5p64x0/common.c
@@ -205,6 +205,7 @@ void __init s5p64x0_init_io(struct map_desc *mach_desc, int size)
205 samsung_pwm_set_platdata(&s5p64x0_pwm_variant); 205 samsung_pwm_set_platdata(&s5p64x0_pwm_variant);
206} 206}
207 207
208#ifdef CONFIG_CPU_S5P6440
208void __init s5p6440_map_io(void) 209void __init s5p6440_map_io(void)
209{ 210{
210 /* initialize any device information early */ 211 /* initialize any device information early */
@@ -218,7 +219,9 @@ void __init s5p6440_map_io(void)
218 219
219 iotable_init(s5p6440_iodesc, ARRAY_SIZE(s5p6440_iodesc)); 220 iotable_init(s5p6440_iodesc, ARRAY_SIZE(s5p6440_iodesc));
220} 221}
222#endif
221 223
224#ifdef CONFIG_CPU_S5P6450
222void __init s5p6450_map_io(void) 225void __init s5p6450_map_io(void)
223{ 226{
224 /* initialize any device information early */ 227 /* initialize any device information early */
@@ -232,13 +235,14 @@ void __init s5p6450_map_io(void)
232 235
233 iotable_init(s5p6450_iodesc, ARRAY_SIZE(s5p6450_iodesc)); 236 iotable_init(s5p6450_iodesc, ARRAY_SIZE(s5p6450_iodesc));
234} 237}
238#endif
235 239
236/* 240/*
237 * s5p64x0_init_clocks 241 * s5p64x0_init_clocks
238 * 242 *
239 * register and setup the CPU clocks 243 * register and setup the CPU clocks
240 */ 244 */
241 245#ifdef CONFIG_CPU_S5P6440
242void __init s5p6440_init_clocks(int xtal) 246void __init s5p6440_init_clocks(int xtal)
243{ 247{
244 printk(KERN_DEBUG "%s: initializing clocks\n", __func__); 248 printk(KERN_DEBUG "%s: initializing clocks\n", __func__);
@@ -248,7 +252,9 @@ void __init s5p6440_init_clocks(int xtal)
248 s5p6440_register_clocks(); 252 s5p6440_register_clocks();
249 s5p6440_setup_clocks(); 253 s5p6440_setup_clocks();
250} 254}
255#endif
251 256
257#ifdef CONFIG_CPU_S5P6450
252void __init s5p6450_init_clocks(int xtal) 258void __init s5p6450_init_clocks(int xtal)
253{ 259{
254 printk(KERN_DEBUG "%s: initializing clocks\n", __func__); 260 printk(KERN_DEBUG "%s: initializing clocks\n", __func__);
@@ -258,13 +264,14 @@ void __init s5p6450_init_clocks(int xtal)
258 s5p6450_register_clocks(); 264 s5p6450_register_clocks();
259 s5p6450_setup_clocks(); 265 s5p6450_setup_clocks();
260} 266}
267#endif
261 268
262/* 269/*
263 * s5p64x0_init_irq 270 * s5p64x0_init_irq
264 * 271 *
265 * register the CPU interrupts 272 * register the CPU interrupts
266 */ 273 */
267 274#ifdef CONFIG_CPU_S5P6440
268void __init s5p6440_init_irq(void) 275void __init s5p6440_init_irq(void)
269{ 276{
270 /* S5P6440 supports 2 VIC */ 277 /* S5P6440 supports 2 VIC */
@@ -279,7 +286,9 @@ void __init s5p6440_init_irq(void)
279 286
280 s5p_init_irq(vic, ARRAY_SIZE(vic)); 287 s5p_init_irq(vic, ARRAY_SIZE(vic));
281} 288}
289#endif
282 290
291#ifdef CONFIG_CPU_S5P6450
283void __init s5p6450_init_irq(void) 292void __init s5p6450_init_irq(void)
284{ 293{
285 /* S5P6450 supports only 2 VIC */ 294 /* S5P6450 supports only 2 VIC */
@@ -294,6 +303,7 @@ void __init s5p6450_init_irq(void)
294 303
295 s5p_init_irq(vic, ARRAY_SIZE(vic)); 304 s5p_init_irq(vic, ARRAY_SIZE(vic));
296} 305}
306#endif
297 307
298struct bus_type s5p64x0_subsys = { 308struct bus_type s5p64x0_subsys = {
299 .name = "s5p64x0-core", 309 .name = "s5p64x0-core",
@@ -321,6 +331,7 @@ int __init s5p64x0_init(void)
321} 331}
322 332
323/* uart registration process */ 333/* uart registration process */
334#ifdef CONFIG_CPU_S5P6440
324void __init s5p6440_init_uarts(struct s3c2410_uartcfg *cfg, int no) 335void __init s5p6440_init_uarts(struct s3c2410_uartcfg *cfg, int no)
325{ 336{
326 int uart; 337 int uart;
@@ -332,11 +343,14 @@ void __init s5p6440_init_uarts(struct s3c2410_uartcfg *cfg, int no)
332 343
333 s3c24xx_init_uartdevs("s3c6400-uart", s5p_uart_resources, cfg, no); 344 s3c24xx_init_uartdevs("s3c6400-uart", s5p_uart_resources, cfg, no);
334} 345}
346#endif
335 347
348#ifdef CONFIG_CPU_S5P6450
336void __init s5p6450_init_uarts(struct s3c2410_uartcfg *cfg, int no) 349void __init s5p6450_init_uarts(struct s3c2410_uartcfg *cfg, int no)
337{ 350{
338 s3c24xx_init_uartdevs("s3c6400-uart", s5p_uart_resources, cfg, no); 351 s3c24xx_init_uartdevs("s3c6400-uart", s5p_uart_resources, cfg, no);
339} 352}
353#endif
340 354
341#define eint_offset(irq) ((irq) - IRQ_EINT(0)) 355#define eint_offset(irq) ((irq) - IRQ_EINT(0))
342 356
diff --git a/arch/arm/mach-s5p64x0/common.h b/arch/arm/mach-s5p64x0/common.h
index f3a9b43cba4a..cbe7f3d731d0 100644
--- a/arch/arm/mach-s5p64x0/common.h
+++ b/arch/arm/mach-s5p64x0/common.h
@@ -25,10 +25,10 @@ void s5p6450_register_clocks(void);
25void s5p6450_setup_clocks(void); 25void s5p6450_setup_clocks(void);
26 26
27void s5p64x0_restart(enum reboot_mode mode, const char *cmd); 27void s5p64x0_restart(enum reboot_mode mode, const char *cmd);
28extern int s5p64x0_init(void);
28 29
29#ifdef CONFIG_CPU_S5P6440 30#ifdef CONFIG_CPU_S5P6440
30 31
31extern int s5p64x0_init(void);
32extern void s5p6440_map_io(void); 32extern void s5p6440_map_io(void);
33extern void s5p6440_init_clocks(int xtal); 33extern void s5p6440_init_clocks(int xtal);
34 34
@@ -38,12 +38,10 @@ extern void s5p6440_init_uarts(struct s3c2410_uartcfg *cfg, int no);
38#define s5p6440_init_clocks NULL 38#define s5p6440_init_clocks NULL
39#define s5p6440_init_uarts NULL 39#define s5p6440_init_uarts NULL
40#define s5p6440_map_io NULL 40#define s5p6440_map_io NULL
41#define s5p64x0_init NULL
42#endif 41#endif
43 42
44#ifdef CONFIG_CPU_S5P6450 43#ifdef CONFIG_CPU_S5P6450
45 44
46extern int s5p64x0_init(void);
47extern void s5p6450_map_io(void); 45extern void s5p6450_map_io(void);
48extern void s5p6450_init_clocks(int xtal); 46extern void s5p6450_init_clocks(int xtal);
49 47
@@ -53,7 +51,6 @@ extern void s5p6450_init_uarts(struct s3c2410_uartcfg *cfg, int no);
53#define s5p6450_init_clocks NULL 51#define s5p6450_init_clocks NULL
54#define s5p6450_init_uarts NULL 52#define s5p6450_init_uarts NULL
55#define s5p6450_map_io NULL 53#define s5p6450_map_io NULL
56#define s5p64x0_init NULL
57#endif 54#endif
58 55
59#endif /* __ARCH_ARM_MACH_S5P64X0_COMMON_H */ 56#endif /* __ARCH_ARM_MACH_S5P64X0_COMMON_H */