292}
293
294
295static void pci_rescan_worker(struct work_struct *work)
296{
297 pci_rescan();
298}
299
300static int enable_slot(struct hotplug_slot *hotplug_slot)
301{
302
303 cancel_work_sync(&pci_rescan_work);
304 queue_work(dummyphp_wq, &pci_rescan_work);
305 return 0;
306}
307
308static int disable_slot(struct hotplug_slot *slot)
309{
310 struct dummy_slot *dslot;
311 struct pci_dev *dev;
312 int func;
313
314 if (!slot)
315 return -ENODEV;
316 dslot = slot->private;
317
318 dbg("%s - physical_slot = %s\n", __func__, hotplug_slot_name(slot));
319
320 for (func = 7; func >= 0; func--) {
321 dev = pci_get_slot(dslot->dev->bus, dslot->dev->devfn + func);
322 if (!dev)
323 continue;
324
325 if (test_and_set_bit(0, &dslot->removed)) {
326 dbg("Slot already scheduled for removal\n");
327 return -ENODEV;
328 }
329
330
331 pci_remove_bus_device(dev);
332