2014-04-12 11:59:07 +00:00
|
|
|
--- a/arch/mips/lantiq/xway/ath_eep.c
|
|
|
|
+++ b/arch/mips/lantiq/xway/ath_eep.c
|
|
|
|
@@ -36,10 +36,11 @@ static int ath9k_pci_plat_dev_init(struc
|
2014-03-30 09:16:31 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
+static int ath9k_eep_load;
|
|
|
|
int __init of_ath9k_eeprom_probe(struct platform_device *pdev)
|
|
|
|
{
|
|
|
|
struct device_node *np = pdev->dev.of_node, *mtd_np;
|
2014-04-03 14:26:46 +00:00
|
|
|
- int mac_offset;
|
|
|
|
+ int mac_offset, led_pin;
|
|
|
|
u32 mac_inc = 0, pci_slot = 0;
|
|
|
|
int i;
|
|
|
|
struct mtd_info *the_mtd;
|
2014-04-12 11:59:07 +00:00
|
|
|
@@ -112,6 +113,18 @@ int __init of_ath9k_eeprom_probe(struct
|
2014-03-30 09:16:31 +00:00
|
|
|
if (!of_property_read_u32(np, "ath,pci-slot", &pci_slot)) {
|
|
|
|
ltq_pci_ath_fixup(pci_slot, ath9k_pdata.eeprom_data);
|
|
|
|
dev_info(&pdev->dev, "pci slot: %u\n", pci_slot);
|
|
|
|
+ if (ath9k_eep_load) {
|
|
|
|
+ struct pci_dev *d = NULL;
|
|
|
|
+ while ((d = pci_get_device(PCI_VENDOR_ID_ATHEROS,
|
|
|
|
+ PCI_ANY_ID, d)) != NULL)
|
|
|
|
+ pci_fixup_device(pci_fixup_early, d);
|
|
|
|
+ }
|
2014-04-03 14:26:46 +00:00
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (!of_property_read_u32(np, "ath,led-pin", &led_pin)) {
|
|
|
|
+ ath9k_pdata.led_pin = led_pin;
|
|
|
|
+
|
|
|
|
+ dev_info(&pdev->dev, "using led pin %d.\n", led_pin);
|
2014-03-30 09:16:31 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
dev_info(&pdev->dev, "loaded ath9k eeprom\n");
|
2014-04-12 11:59:07 +00:00
|
|
|
@@ -132,20 +145,19 @@ static struct platform_driver ath9k_eepr
|
2014-03-30 09:16:31 +00:00
|
|
|
},
|
|
|
|
};
|
|
|
|
|
|
|
|
-static int ath9k_eep_loaded;
|
|
|
|
static int __init of_ath9k_eeprom_init(void)
|
|
|
|
{
|
|
|
|
int ret = platform_driver_probe(&ath9k_eeprom_driver, of_ath9k_eeprom_probe);
|
|
|
|
|
|
|
|
- if (!ret)
|
|
|
|
- ath9k_eep_loaded = 1;
|
|
|
|
+ if (ret)
|
|
|
|
+ ath9k_eep_load = 1;
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int __init of_ath9k_eeprom_init_late(void)
|
|
|
|
{
|
|
|
|
- if (ath9k_eep_loaded)
|
|
|
|
+ if (!ath9k_eep_load)
|
|
|
|
return 0;
|
|
|
|
return platform_driver_probe(&ath9k_eeprom_driver, of_ath9k_eeprom_probe);
|
|
|
|
}
|
2014-04-12 11:59:07 +00:00
|
|
|
@@ -247,4 +259,4 @@ static int __init of_ath5k_eeprom_init(v
|
2014-03-30 09:16:31 +00:00
|
|
|
{
|
|
|
|
return platform_driver_probe(&ath5k_eeprom_driver, of_ath5k_eeprom_probe);
|
|
|
|
}
|
|
|
|
-device_initcall(of_ath5k_eeprom_init);
|
|
|
|
+subsys_initcall(of_ath5k_eeprom_init);
|