return 0;
}
-static int pcistub_device_id_remove(int domain, int bus, int slot, int func)
+static int pcistub_device_id_remove(int domain, int bus, int slot, int func, int type)
{
struct pcistub_device_id *pci_dev_id, *t;
int devfn = PCI_DEVFN(slot, func);
spin_lock_irqsave(&device_ids_lock, flags);
list_for_each_entry_safe(pci_dev_id, t, &pcistub_device_ids, slot_list) {
- if (pci_dev_id->domain == domain
+ if (pci_dev_id->type == type && pci_dev_id->domain == domain
&& pci_dev_id->bus == bus && pci_dev_id->devfn == devfn) {
/* Don't break; here because it's possible the same
* slot could be in the list more than once
if (err)
goto out;
- err = pcistub_device_id_remove(domain, bus, slot, func);
+ err = pcistub_device_id_remove(domain, bus, slot, func, PCIBACK_ID_TYPE_HIDE);
out:
if (!err)
spin_lock_irqsave(&device_ids_lock, flags);
list_for_each_entry(pci_dev_id, &pcistub_device_ids, slot_list) {
+ /* only want devices set for hid, not reset entries */
+ if (pci_dev_id->type != PCIBACK_ID_TYPE_HIDE)
+ continue;
+
if (count >= PAGE_SIZE)
break;