aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorGabor Juhos <juhosg@openwrt.org>2012-03-14 05:36:08 -0400
committerRalf Baechle <ralf@linux-mips.org>2012-05-15 11:49:04 -0400
commit881b6ef0cca3395ac0171472a1ce768fede7535b (patch)
treea59dabc68964b8e2a5edd147b7999f1c8fe64ea9 /arch
parent4c07c7dfa0f3575dc3276c544349fbf181381167 (diff)
MIPS: ath79: get rid of some ifdefs in mach-ubnt-xm.c
Remove a superfluous ifdef around an include. Also reorganize the board setup code a bit, so another ifdef can be removed. Signed-off-by: Gabor Juhos <juhosg@openwrt.org> Cc: linux-mips@linux-mips.org Patchwork: https://patchwork.linux-mips.org/patch/3497/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/mips/ath79/mach-ubnt-xm.c23
1 files changed, 12 insertions, 11 deletions
diff --git a/arch/mips/ath79/mach-ubnt-xm.c b/arch/mips/ath79/mach-ubnt-xm.c
index 0d95b67a7d4f..1e6b986cb470 100644
--- a/arch/mips/ath79/mach-ubnt-xm.c
+++ b/arch/mips/ath79/mach-ubnt-xm.c
@@ -12,10 +12,7 @@
12 12
13#include <linux/init.h> 13#include <linux/init.h>
14#include <linux/pci.h> 14#include <linux/pci.h>
15
16#ifdef CONFIG_PCI
17#include <linux/ath9k_platform.h> 15#include <linux/ath9k_platform.h>
18#endif /* CONFIG_PCI */
19 16
20#include <asm/mach-ath79/irq.h> 17#include <asm/mach-ath79/irq.h>
21 18
@@ -91,6 +88,17 @@ static struct ar724x_pci_data ubnt_xm_pci_data[] = {
91 .pdata = &ubnt_xm_eeprom_data, 88 .pdata = &ubnt_xm_eeprom_data,
92 }, 89 },
93}; 90};
91
92static void __init ubnt_xm_pci_init(void)
93{
94 memcpy(ubnt_xm_eeprom_data.eeprom_data, UBNT_XM_EEPROM_ADDR,
95 sizeof(ubnt_xm_eeprom_data.eeprom_data));
96
97 ar724x_pci_add_data(ubnt_xm_pci_data, ARRAY_SIZE(ubnt_xm_pci_data));
98 ath79_register_pci();
99}
100#else
101static inline void ubnt_xm_pci_init(void) {}
94#endif /* CONFIG_PCI */ 102#endif /* CONFIG_PCI */
95 103
96static void __init ubnt_xm_init(void) 104static void __init ubnt_xm_init(void)
@@ -105,14 +113,7 @@ static void __init ubnt_xm_init(void)
105 ath79_register_spi(&ubnt_xm_spi_data, ubnt_xm_spi_info, 113 ath79_register_spi(&ubnt_xm_spi_data, ubnt_xm_spi_info,
106 ARRAY_SIZE(ubnt_xm_spi_info)); 114 ARRAY_SIZE(ubnt_xm_spi_info));
107 115
108#ifdef CONFIG_PCI 116 ubnt_xm_pci_init();
109 memcpy(ubnt_xm_eeprom_data.eeprom_data, UBNT_XM_EEPROM_ADDR,
110 sizeof(ubnt_xm_eeprom_data.eeprom_data));
111
112 ar724x_pci_add_data(ubnt_xm_pci_data, ARRAY_SIZE(ubnt_xm_pci_data));
113#endif /* CONFIG_PCI */
114
115 ath79_register_pci();
116} 117}
117 118
118MIPS_MACHINE(ATH79_MACH_UBNT_XM, 119MIPS_MACHINE(ATH79_MACH_UBNT_XM,