- bridge_dev = slot->bridge;
- if (!bridge_dev) {
- printk(KERN_ERR "%s: unexpected null bridge device\n",
- __FUNCTION__);
- return -EIO;
+ bus = pcibios_find_pci_bus(dn);
+ if (!bus)
+ return -EINVAL;
+
+ slot = find_slot(dn);
+ if (slot) {
+ /* Remove hotplug slot */
+ if (rpaphp_deregister_slot(slot)) {
+ printk(KERN_ERR
+ "%s: unable to remove hotplug slot %s\n",
+ __FUNCTION__, drc_name);
+ return -EIO;
+ }
+ } else {
+ struct pci_dev *dev, *tmp;
+ list_for_each_entry_safe(dev, tmp, &bus->devices, bus_list) {
+ eeh_remove_bus_device(dev);
+ pci_remove_bus_device(dev);
+ }