diff options
-rw-r--r-- | core/pci.c | 3 | ||||
-rw-r--r-- | hw/p7ioc-phb.c | 1 | ||||
-rw-r--r-- | hw/phb3.c | 1 | ||||
-rw-r--r-- | hw/phb4.c | 1 | ||||
-rw-r--r-- | include/pci.h | 1 |
5 files changed, 7 insertions, 0 deletions
@@ -526,6 +526,9 @@ void pci_remove_bus(struct phb *phb, struct list_head *list) list_for_each_safe(list, pd, tmp, link) { pci_remove_bus(phb, &pd->children); + if (phb->ops->device_remove) + phb->ops->device_remove(phb, pd); + /* Release device node and PCI slot */ if (pd->dn) dt_free(pd->dn); diff --git a/hw/p7ioc-phb.c b/hw/p7ioc-phb.c index 82d4f159..21f6c3e1 100644 --- a/hw/p7ioc-phb.c +++ b/hw/p7ioc-phb.c @@ -2318,6 +2318,7 @@ static const struct phb_ops p7ioc_phb_ops = { .choose_bus = p7ioc_choose_bus, .get_reserved_pe_number = p7ioc_get_reserved_pe_number, .device_init = p7ioc_device_init, + .device_remove = NULL, .pci_reinit = p7ioc_pci_reinit, .eeh_freeze_status = p7ioc_eeh_freeze_status, .eeh_freeze_clear = p7ioc_eeh_freeze_clear, @@ -3810,6 +3810,7 @@ static const struct phb_ops phb3_ops = { .choose_bus = phb3_choose_bus, .get_reserved_pe_number = phb3_get_reserved_pe_number, .device_init = phb3_device_init, + .device_remove = NULL, .ioda_reset = phb3_ioda_reset, .papr_errinjct_reset = phb3_papr_errinjct_reset, .pci_reinit = phb3_pci_reinit, @@ -2371,6 +2371,7 @@ static const struct phb_ops phb4_ops = { .choose_bus = phb4_choose_bus, .get_reserved_pe_number = phb4_get_reserved_pe_number, .device_init = phb4_device_init, + .device_remove = NULL, .ioda_reset = phb4_ioda_reset, .papr_errinjct_reset = phb4_papr_errinjct_reset, .pci_reinit = phb4_pci_reinit, diff --git a/include/pci.h b/include/pci.h index 732c1a36..dc418a90 100644 --- a/include/pci.h +++ b/include/pci.h @@ -207,6 +207,7 @@ struct phb_ops { */ int (*device_init)(struct phb *phb, struct pci_device *device, void *data); + void (*device_remove)(struct phb *phb, struct pci_device *pd); /* PHB final fixup is called after PCI probing is completed */ void (*phb_final_fixup)(struct phb *phb); |