diff options
| author | John Baldwin <jhb@FreeBSD.org> | 2026-05-18 18:52:23 +0000 |
|---|---|---|
| committer | John Baldwin <jhb@FreeBSD.org> | 2026-05-18 18:52:23 +0000 |
| commit | 6dc813301a173e2e1993c3064df162e6218c1231 (patch) | |
| tree | 8416dfcfe0481ac2a06eb075cda5f9a1414c77e3 /sys/x86 | |
| parent | ffcf5e356644252f2f6c89ba01057af45c216559 (diff) | |
Diffstat (limited to 'sys/x86')
| -rw-r--r-- | sys/x86/iommu/amd_drv.c | 3 | ||||
| -rw-r--r-- | sys/x86/iommu/intel_drv.c | 13 |
2 files changed, 4 insertions, 12 deletions
diff --git a/sys/x86/iommu/amd_drv.c b/sys/x86/iommu/amd_drv.c index fc9770e1a32b..d45c576856eb 100644 --- a/sys/x86/iommu/amd_drv.c +++ b/sys/x86/iommu/amd_drv.c @@ -894,8 +894,7 @@ amdiommu_find_unit(device_t dev, struct amdiommu_unit **unitp, uint16_t *ridp, if (!amdiommu_enable) return (ENXIO); - if (device_get_devclass(device_get_parent(dev)) != - devclass_find("pci")) + if (!is_pci_device(dev)) return (ENXIO); bzero(&ifu, sizeof(ifu)); diff --git a/sys/x86/iommu/intel_drv.c b/sys/x86/iommu/intel_drv.c index 28db14bba95b..185ed9c1a628 100644 --- a/sys/x86/iommu/intel_drv.c +++ b/sys/x86/iommu/intel_drv.c @@ -605,16 +605,13 @@ dmar_print_path(int busno, int depth, const ACPI_DMAR_PCI_PATH *path) int dmar_dev_depth(device_t child) { - devclass_t pci_class; device_t bus, pcib; int depth; - pci_class = devclass_find("pci"); for (depth = 1; ; depth++) { bus = device_get_parent(child); pcib = device_get_parent(bus); - if (device_get_devclass(device_get_parent(pcib)) != - pci_class) + if (!is_pci_device(pcib)) return (depth); child = pcib; } @@ -623,19 +620,16 @@ dmar_dev_depth(device_t child) void dmar_dev_path(device_t child, int *busno, void *path1, int depth) { - devclass_t pci_class; device_t bus, pcib; ACPI_DMAR_PCI_PATH *path; - pci_class = devclass_find("pci"); path = path1; for (depth--; depth != -1; depth--) { path[depth].Device = pci_get_slot(child); path[depth].Function = pci_get_function(child); bus = device_get_parent(child); pcib = device_get_parent(bus); - if (device_get_devclass(device_get_parent(pcib)) != - pci_class) { + if (!is_pci_device(pcib)) { /* reached a host bridge */ *busno = pcib_get_bus(bus); return; @@ -765,8 +759,7 @@ dmar_find(device_t dev, bool verbose) /* * This function can only handle PCI(e) devices. */ - if (device_get_devclass(device_get_parent(dev)) != - devclass_find("pci")) + if (!is_pci_device(dev)) return (NULL); dev_domain = pci_get_domain(dev); |
