kernel: update 3.10 to 3.10.36
[openwrt/openwrt.git] / target / linux / lantiq / patches-3.10 / 0202-lantiq_ath5k.patch
1 --- a/arch/mips/lantiq/xway/ath_eep.c
2 +++ b/arch/mips/lantiq/xway/ath_eep.c
3 @@ -36,10 +36,11 @@ static int ath9k_pci_plat_dev_init(struc
4 return 0;
5 }
6
7 +static int ath9k_eep_load;
8 int __init of_ath9k_eeprom_probe(struct platform_device *pdev)
9 {
10 struct device_node *np = pdev->dev.of_node, *mtd_np;
11 - int mac_offset;
12 + int mac_offset, led_pin;
13 u32 mac_inc = 0, pci_slot = 0;
14 int i;
15 struct mtd_info *the_mtd;
16 @@ -112,6 +113,18 @@ int __init of_ath9k_eeprom_probe(struct
17 if (!of_property_read_u32(np, "ath,pci-slot", &pci_slot)) {
18 ltq_pci_ath_fixup(pci_slot, ath9k_pdata.eeprom_data);
19 dev_info(&pdev->dev, "pci slot: %u\n", pci_slot);
20 + if (ath9k_eep_load) {
21 + struct pci_dev *d = NULL;
22 + while ((d = pci_get_device(PCI_VENDOR_ID_ATHEROS,
23 + PCI_ANY_ID, d)) != NULL)
24 + pci_fixup_device(pci_fixup_early, d);
25 + }
26 + }
27 +
28 + if (!of_property_read_u32(np, "ath,led-pin", &led_pin)) {
29 + ath9k_pdata.led_pin = led_pin;
30 +
31 + dev_info(&pdev->dev, "using led pin %d.\n", led_pin);
32 }
33
34 dev_info(&pdev->dev, "loaded ath9k eeprom\n");
35 @@ -132,20 +145,19 @@ static struct platform_driver ath9k_eepr
36 },
37 };
38
39 -static int ath9k_eep_loaded;
40 static int __init of_ath9k_eeprom_init(void)
41 {
42 int ret = platform_driver_probe(&ath9k_eeprom_driver, of_ath9k_eeprom_probe);
43
44 - if (!ret)
45 - ath9k_eep_loaded = 1;
46 + if (ret)
47 + ath9k_eep_load = 1;
48
49 return ret;
50 }
51
52 static int __init of_ath9k_eeprom_init_late(void)
53 {
54 - if (ath9k_eep_loaded)
55 + if (!ath9k_eep_load)
56 return 0;
57 return platform_driver_probe(&ath9k_eeprom_driver, of_ath9k_eeprom_probe);
58 }
59 @@ -247,4 +259,4 @@ static int __init of_ath5k_eeprom_init(v
60 {
61 return platform_driver_probe(&ath5k_eeprom_driver, of_ath5k_eeprom_probe);
62 }
63 -device_initcall(of_ath5k_eeprom_init);
64 +subsys_initcall(of_ath5k_eeprom_init);