Commit 4c853b56 authored by Scott Murray's avatar Scott Murray

[CPCI] Minimal fixes to restore CPCI hotplug to working order

Removed double kfree in unconfigure_visit_pci_dev_phase2, and
added a call to pci_bus_add_devices in cpci_configure_slot.
parent e5d2e2a9
...@@ -494,9 +494,7 @@ static int unconfigure_visit_pci_dev_phase2(struct pci_dev_wrapped *wrapped_dev, ...@@ -494,9 +494,7 @@ static int unconfigure_visit_pci_dev_phase2(struct pci_dev_wrapped *wrapped_dev,
return -ENODEV; return -ENODEV;
/* Remove the Linux representation */ /* Remove the Linux representation */
if(pci_remove_device_safe(dev) == 0) { if(pci_remove_device_safe(dev)) {
kfree(dev);
} else {
err("Could not remove device\n"); err("Could not remove device\n");
return -1; return -1;
} }
...@@ -574,13 +572,18 @@ int cpci_configure_slot(struct slot* slot) ...@@ -574,13 +572,18 @@ int cpci_configure_slot(struct slot* slot)
/* Still NULL? Well then scan for it! */ /* Still NULL? Well then scan for it! */
if(slot->dev == NULL) { if(slot->dev == NULL) {
int n;
dbg("pci_dev still null"); dbg("pci_dev still null");
/* /*
* This will generate pci_dev structures for all functions, but * This will generate pci_dev structures for all functions, but
* we will only call this case when lookup fails. * we will only call this case when lookup fails.
*/ */
slot->dev = pci_scan_slot(slot->bus, slot->devfn); n = pci_scan_slot(slot->bus, slot->devfn);
dbg("%s: pci_scan_slot returned %d", __FUNCTION__, n);
if(n > 0)
pci_bus_add_devices(slot->bus);
slot->dev = pci_find_slot(slot->bus->number, slot->devfn);
if(slot->dev == NULL) { if(slot->dev == NULL) {
err("Could not find PCI device for slot %02x", slot->number); err("Could not find PCI device for slot %02x", slot->number);
return 0; return 0;
......
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