Root/target/linux/ar71xx/patches-3.3/114-MIPS-ath79-get-rid-of-some-ifdefs-in-mach-ubnt-xm.c.patch

1From adeefb0860e92f44c7d66d5fccdb217fccfb8a81 Mon Sep 17 00:00:00 2001
2From: Gabor Juhos <juhosg@openwrt.org>
3Date: Sun, 20 Nov 2011 10:19:08 +0100
4Subject: [PATCH 14/35] MIPS: ath79: get rid of some ifdefs in mach-ubnt-xm.c
5
6Remove a superfluous ifdef around an include. Also
7reorganize the board setup code a bit, so another
8ifdef can be removed.
9
10Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
11
12v2: - no changes
13---
14 arch/mips/ath79/mach-ubnt-xm.c | 23 ++++++++++++-----------
15 1 files changed, 12 insertions(+), 11 deletions(-)
16
17--- a/arch/mips/ath79/mach-ubnt-xm.c
18+++ b/arch/mips/ath79/mach-ubnt-xm.c
19@@ -12,10 +12,7 @@
20 
21 #include <linux/init.h>
22 #include <linux/pci.h>
23-
24-#ifdef CONFIG_PCI
25 #include <linux/ath9k_platform.h>
26-#endif /* CONFIG_PCI */
27 
28 #include <asm/mach-ath79/irq.h>
29 
30@@ -91,6 +88,17 @@ static struct ar724x_pci_data ubnt_xm_pc
31         .pdata = &ubnt_xm_eeprom_data,
32     },
33 };
34+
35+static void __init ubnt_xm_pci_init(void)
36+{
37+ memcpy(ubnt_xm_eeprom_data.eeprom_data, UBNT_XM_EEPROM_ADDR,
38+ sizeof(ubnt_xm_eeprom_data.eeprom_data));
39+
40+ ar724x_pci_add_data(ubnt_xm_pci_data, ARRAY_SIZE(ubnt_xm_pci_data));
41+ ath79_register_pci();
42+}
43+#else
44+static inline void ubnt_xm_pci_init(void) {}
45 #endif /* CONFIG_PCI */
46 
47 static void __init ubnt_xm_init(void)
48@@ -105,14 +113,7 @@ static void __init ubnt_xm_init(void)
49     ath79_register_spi(&ubnt_xm_spi_data, ubnt_xm_spi_info,
50                ARRAY_SIZE(ubnt_xm_spi_info));
51 
52-#ifdef CONFIG_PCI
53- memcpy(ubnt_xm_eeprom_data.eeprom_data, UBNT_XM_EEPROM_ADDR,
54- sizeof(ubnt_xm_eeprom_data.eeprom_data));
55-
56- ar724x_pci_add_data(ubnt_xm_pci_data, ARRAY_SIZE(ubnt_xm_pci_data));
57-#endif /* CONFIG_PCI */
58-
59- ath79_register_pci();
60+ ubnt_xm_pci_init();
61 }
62 
63 MIPS_MACHINE(ATH79_MACH_UBNT_XM,
64

Archive Download this file



interactive