Commit ac27a097 authored by Arjan van de Ven's avatar Arjan van de Ven Committed by Jeff Garzik

Move pci_enable_device and associated code above first PCI resource info access.

parent 165f042e
......@@ -570,6 +570,19 @@ static int __devinit eepro100_init_one (struct pci_dev *pdev,
if (speedo_debug > 0 && did_version++ == 0)
printk(version);
/* save power state before pci_enable_device overwrites it */
pm = pci_find_capability(pdev, PCI_CAP_ID_PM);
if (pm) {
u16 pwr_command;
pci_read_config_word(pdev, pm + PCI_PM_CTRL, &pwr_command);
acpi_idle_state = pwr_command & PCI_PM_CTRL_STATE_MASK;
}
if (pci_enable_device(pdev))
goto err_out_free_mmio_region;
pci_set_master(pdev);
if (!request_region(pci_resource_start(pdev, 1),
pci_resource_len(pdev, 1), "eepro100")) {
printk (KERN_ERR "eepro100: cannot reserve I/O ports\n");
......@@ -600,18 +613,6 @@ static int __devinit eepro100_init_one (struct pci_dev *pdev,
pci_resource_start(pdev, 0), irq);
#endif
/* save power state b4 pci_enable_device overwrites it */
pm = pci_find_capability(pdev, PCI_CAP_ID_PM);
if (pm) {
u16 pwr_command;
pci_read_config_word(pdev, pm + PCI_PM_CTRL, &pwr_command);
acpi_idle_state = pwr_command & PCI_PM_CTRL_STATE_MASK;
}
if (pci_enable_device(pdev))
goto err_out_free_mmio_region;
pci_set_master(pdev);
if (speedo_found1(pdev, ioaddr, cards_found, acpi_idle_state) == 0)
cards_found++;
......
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