--- hotplug.c.orig 2003-06-22 16:00:25.000000000 -0500 +++ hotplug.c 2003-06-22 16:54:33.000000000 -0500 @@ -11,6 +11,7 @@ #endif static void pci_free_resources(struct pci_dev *dev); +static void pci_destroy_dev(struct pci_dev *dev); #ifdef CONFIG_HOTPLUG int pci_hotplug (struct device *dev, char **envp, int num_envp, @@ -173,24 +174,6 @@ int pci_visit_dev (struct pci_visit *fn, } EXPORT_SYMBOL(pci_visit_dev); -static void pci_destroy_dev(struct pci_dev *dev) -{ - pci_proc_detach_device(dev); - device_unregister(&dev->dev); - - /* Remove the device from the device lists, and prevent any further - * list accesses from this device */ - spin_lock(&pci_bus_lock); - list_del(&dev->bus_list); - list_del(&dev->global_list); - dev->bus_list.next = dev->bus_list.prev = NULL; - dev->global_list.next = dev->global_list.prev = NULL; - spin_unlock(&pci_bus_lock); - - pci_free_resources(dev); - pci_dev_put(dev); -} - /** * pci_remove_device_safe - remove an unused hotplug device * @dev: the device to remove @@ -219,6 +202,24 @@ int pci_hotplug (struct device *dev, cha #endif /* CONFIG_HOTPLUG */ +static void pci_destroy_dev(struct pci_dev *dev) +{ + pci_proc_detach_device(dev); + device_unregister(&dev->dev); + + /* Remove the device from the device lists, and prevent any further + * list accesses from this device */ + spin_lock(&pci_bus_lock); + list_del(&dev->bus_list); + list_del(&dev->global_list); + dev->bus_list.next = dev->bus_list.prev = NULL; + dev->global_list.next = dev->global_list.prev = NULL; + spin_unlock(&pci_bus_lock); + + pci_free_resources(dev); + pci_dev_put(dev); +} + static void pci_free_resources(struct pci_dev *dev) {