Commit 881b6ef0 authored by Gabor Juhos's avatar Gabor Juhos Committed by Ralf Baechle

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: default avatarGabor Juhos <juhosg@openwrt.org>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/3497/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
parent 4c07c7df
...@@ -12,10 +12,7 @@ ...@@ -12,10 +12,7 @@
#include <linux/init.h> #include <linux/init.h>
#include <linux/pci.h> #include <linux/pci.h>
#ifdef CONFIG_PCI
#include <linux/ath9k_platform.h> #include <linux/ath9k_platform.h>
#endif /* CONFIG_PCI */
#include <asm/mach-ath79/irq.h> #include <asm/mach-ath79/irq.h>
...@@ -91,6 +88,17 @@ static struct ar724x_pci_data ubnt_xm_pci_data[] = { ...@@ -91,6 +88,17 @@ static struct ar724x_pci_data ubnt_xm_pci_data[] = {
.pdata = &ubnt_xm_eeprom_data, .pdata = &ubnt_xm_eeprom_data,
}, },
}; };
static void __init ubnt_xm_pci_init(void)
{
memcpy(ubnt_xm_eeprom_data.eeprom_data, UBNT_XM_EEPROM_ADDR,
sizeof(ubnt_xm_eeprom_data.eeprom_data));
ar724x_pci_add_data(ubnt_xm_pci_data, ARRAY_SIZE(ubnt_xm_pci_data));
ath79_register_pci();
}
#else
static inline void ubnt_xm_pci_init(void) {}
#endif /* CONFIG_PCI */ #endif /* CONFIG_PCI */
static void __init ubnt_xm_init(void) static void __init ubnt_xm_init(void)
...@@ -105,14 +113,7 @@ static void __init ubnt_xm_init(void) ...@@ -105,14 +113,7 @@ static void __init ubnt_xm_init(void)
ath79_register_spi(&ubnt_xm_spi_data, ubnt_xm_spi_info, ath79_register_spi(&ubnt_xm_spi_data, ubnt_xm_spi_info,
ARRAY_SIZE(ubnt_xm_spi_info)); ARRAY_SIZE(ubnt_xm_spi_info));
#ifdef CONFIG_PCI ubnt_xm_pci_init();
memcpy(ubnt_xm_eeprom_data.eeprom_data, UBNT_XM_EEPROM_ADDR,
sizeof(ubnt_xm_eeprom_data.eeprom_data));
ar724x_pci_add_data(ubnt_xm_pci_data, ARRAY_SIZE(ubnt_xm_pci_data));
#endif /* CONFIG_PCI */
ath79_register_pci();
} }
MIPS_MACHINE(ATH79_MACH_UBNT_XM, MIPS_MACHINE(ATH79_MACH_UBNT_XM,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment