aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/pci/pci_host_generic_fdt.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/dev/pci/pci_host_generic_fdt.c')
-rw-r--r--sys/dev/pci/pci_host_generic_fdt.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/sys/dev/pci/pci_host_generic_fdt.c b/sys/dev/pci/pci_host_generic_fdt.c
index ffe63b82a234..c6b9371698b6 100644
--- a/sys/dev/pci/pci_host_generic_fdt.c
+++ b/sys/dev/pci/pci_host_generic_fdt.c
@@ -104,6 +104,25 @@ generic_pcie_fdt_probe(device_t dev)
return (ENXIO);
}
+void
+pci_host_generic_destroy_fdt(device_t dev)
+{
+ struct generic_pcie_fdt_softc *sc;
+ struct pci_ofw_devinfo *di;
+
+ sc = device_get_softc(dev);
+ while (!STAILQ_EMPTY(&sc->pci_ofw_devlist)) {
+ di = STAILQ_FIRST(&sc->pci_ofw_devlist);
+ STAILQ_REMOVE_HEAD(&sc->pci_ofw_devlist, pci_ofw_link);
+
+ ofw_bus_gen_destroy_devinfo(&di->di_dinfo);
+ free(di, M_DEVBUF);
+ }
+
+ ofw_bus_destroy_iinfo(&sc->pci_iinfo);
+ (void)pci_host_generic_core_free(dev);
+}
+
int
pci_host_generic_setup_fdt(device_t dev)
{