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

1From b2ab491ed634a4c0b7af5f11940e0ca42b1a87c8 Mon Sep 17 00:00:00 2001
2From: Gabor Juhos <juhosg@openwrt.org>
3Date: Wed, 14 Mar 2012 10:36:08 +0100
4Subject: [PATCH 17/47] 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>
11Cc: linux-mips@linux-mips.org
12Patchwork: https://patchwork.linux-mips.org/patch/3497/
13Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
14---
15 arch/mips/ath79/mach-ubnt-xm.c | 23 ++++++++++++-----------
16 1 files changed, 12 insertions(+), 11 deletions(-)
17
18--- a/arch/mips/ath79/mach-ubnt-xm.c
19+++ b/arch/mips/ath79/mach-ubnt-xm.c
20@@ -12,10 +12,7 @@
21 
22 #include <linux/init.h>
23 #include <linux/pci.h>
24-
25-#ifdef CONFIG_PCI
26 #include <linux/ath9k_platform.h>
27-#endif /* CONFIG_PCI */
28 
29 #include <asm/mach-ath79/irq.h>
30 
31@@ -91,6 +88,17 @@ static struct ar724x_pci_data ubnt_xm_pc
32         .pdata = &ubnt_xm_eeprom_data,
33     },
34 };
35+
36+static void __init ubnt_xm_pci_init(void)
37+{
38+ memcpy(ubnt_xm_eeprom_data.eeprom_data, UBNT_XM_EEPROM_ADDR,
39+ sizeof(ubnt_xm_eeprom_data.eeprom_data));
40+
41+ ar724x_pci_add_data(ubnt_xm_pci_data, ARRAY_SIZE(ubnt_xm_pci_data));
42+ ath79_register_pci();
43+}
44+#else
45+static inline void ubnt_xm_pci_init(void) {}
46 #endif /* CONFIG_PCI */
47 
48 static void __init ubnt_xm_init(void)
49@@ -105,14 +113,7 @@ static void __init ubnt_xm_init(void)
50     ath79_register_spi(&ubnt_xm_spi_data, ubnt_xm_spi_info,
51                ARRAY_SIZE(ubnt_xm_spi_info));
52 
53-#ifdef CONFIG_PCI
54- memcpy(ubnt_xm_eeprom_data.eeprom_data, UBNT_XM_EEPROM_ADDR,
55- sizeof(ubnt_xm_eeprom_data.eeprom_data));
56-
57- ar724x_pci_add_data(ubnt_xm_pci_data, ARRAY_SIZE(ubnt_xm_pci_data));
58-#endif /* CONFIG_PCI */
59-
60- ath79_register_pci();
61+ ubnt_xm_pci_init();
62 }
63 
64 MIPS_MACHINE(ATH79_MACH_UBNT_XM,
65

Archive Download this file



interactive