Skip to contentSkip to conversation

Get rid of conditional includes of board specific setup

PATCH Superseded Jochen Friedrich 2 participants 2 messages Jan 18, 2008 – Jan 19, 2008

Subsystems (2)

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH 6/7 Get rid of conditional includes of board specific setup

Directly include mpc885ads.h from mpc885ads_setup.c. Now we can get rid of the arch dependent includes in mpc8xx.h.

---
arch/powerpc/platforms/8xx/mpc885ads_setup.c | 2 +
include/asm-powerpc/mpc8xx.h | 29 ++++++++-----------------

2 files changed, 11 insertions(+), 20 deletions(-)
arch/powerpc/platforms/8xx/mpc885ads_setup.c +0 -0
index ae69e93..426b897 100644
@@ -40,6 +40,8 @@

#include <asm/fs_pd.h>
#include <asm/udbg.h>

+#include "mpc885ads.h"
+
static u32 __iomem *bcsr, *bcsr5;

#ifdef CONFIG_PCMCIA_M8XX

include/asm-powerpc/mpc8xx.h +9 -6
index 2af9fcb..afdb89f 100644
@@ -1,14 +1,16 @@
-/* This is the single file included by all MPC8xx build options.
- * Since there are many different boards and no standard configuration,
- * we have a unique include file for each.  Rather than change every
- * file that has to include MPC8xx configuration, they all include
- * this one and the configuration switching is done here.
+/*
+ * Prototypes, etc. for the Freescale MPC8xx embedded cpu chips
+ * May need to be cleaned as the port goes on ...
+ *
+ * Copyright (C) 2008 Jochen Friedrich <[email protected]>
+ *
+ * This file is licensed under the terms of the GNU General Public License
+ * version 2. This program is licensed "as is" without any warranty of any
+ * kind, whether express or implied.
 */
-#ifdef __KERNEL__

#ifndef __CONFIG_8xx_DEFS
#define __CONFIG_8xx_DEFS

-
#ifdef CONFIG_8xx

extern void mpc8xx_restart(char *cmd);
@@ -18,22 +20,9 @@ extern void mpc8xx_get_rtc_time(struct rtc_time *tm); extern void mpc8xx_pics_init(void);
extern unsigned int mpc8xx_get_irq(void);

-#ifdef CONFIG_FADS
-#include <platforms/fads.h>
-#endif
-
-#if defined(CONFIG_MPC86XADS)
-#include <platforms/8xx/mpc86xads.h>
-#endif
-
-#if defined(CONFIG_MPC885ADS)
-#include <platforms/8xx/mpc885ads.h>
-#endif
-
#ifdef CONFIG_PCMCIA_M8XX
extern struct mpc8xx_pcmcia_ops m8xx_pcmcia_ops;
#endif

#endif /* CONFIG_8xx */
#endif /* __CONFIG_8xx_DEFS */
-#endif /* __KERNEL__ */

Signature · 1 line
1.5.3.8
#1 lore raw
Quoted 2 lines · Jochen Friedrich

Directly include mpc885ads.h from mpc885ads_setup.c. Now we can get rid of the arch dependent includes in mpc8xx.h.

Ah, very nice. How close are we to enabling an 8xx multiplatform build after this?

Quoted 11 lines

=A0#ifdef CONFIG_8xx
=A0
=A0extern void mpc8xx_restart(char *cmd);

(quoted diff) +0 -0
@@ -18,22 +20,9 @@ extern void mpc8xx_get_rtc_time(struct rtc_time *tm);
 =A0extern void mpc8xx_pics_init(void);
 =A0extern unsigned int mpc8xx_get_irq(void);
 

=20
#ifdef CONFIG_PCMCIA_M8XX
extern struct mpc8xx_pcmcia_ops m8xx_pcmcia_ops;
#endif

=20

Quoted 2 lines

=A0#endif /* CONFIG_8xx */
=A0#endif /* __CONFIG_8xx_DEFS */

You can also kill the #ifdef CONFIG_8xx and the #ifdef CONFIG_PCMCIA_M8XX, there is no point hiding extern declarations behind an #ifdef, but it has the disadvantage of causing unnecessary rebuilds if the configuration symbols change.

	Arnd <><