aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/pci
diff options
context:
space:
mode:
authorJohn Baldwin <jhb@FreeBSD.org>2024-02-16 01:56:01 +0000
committerJohn Baldwin <jhb@FreeBSD.org>2025-02-27 13:09:21 +0000
commit2afea415b91992f401b795dc6cbdd9539367d344 (patch)
tree7739a4841a4db06e94b3a4a8c5d80da99ebae197 /sys/dev/pci
parentc8e37e38080dac3287578ab05d4d8e28046a2493 (diff)
Diffstat (limited to 'sys/dev/pci')
-rw-r--r--sys/dev/pci/pci_host_generic.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/sys/dev/pci/pci_host_generic.c b/sys/dev/pci/pci_host_generic.c
index ca384d9a1483..386b8411d29a 100644
--- a/sys/dev/pci/pci_host_generic.c
+++ b/sys/dev/pci/pci_host_generic.c
@@ -431,16 +431,24 @@ int
pci_host_generic_core_release_resource(device_t dev, device_t child, int type,
int rid, struct resource *res)
{
+#if defined(NEW_PCIB) && defined(PCI_RES_BUS)
struct generic_pcie_core_softc *sc;
sc = device_get_softc(dev);
-
+#endif
+ switch (type) {
#if defined(NEW_PCIB) && defined(PCI_RES_BUS)
- if (type == PCI_RES_BUS) {
+ case PCI_RES_BUS:
return (pci_domain_release_bus(sc->ecam, child, rid, res));
- }
#endif
- return (bus_generic_rman_release_resource(dev, child, type, rid, res));
+ case SYS_RES_IOPORT:
+ case SYS_RES_MEMORY:
+ return (bus_generic_rman_release_resource(dev, child, type, rid,
+ res));
+ default:
+ return (bus_generic_release_resource(dev, child, type, rid,
+ res));
+ }
}
static struct pcie_range *