aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/pci
diff options
context:
space:
mode:
Diffstat (limited to 'sys/dev/pci')
-rw-r--r--sys/dev/pci/pci.c10
-rw-r--r--sys/dev/pci/vga_pci.c6
2 files changed, 4 insertions, 12 deletions
diff --git a/sys/dev/pci/pci.c b/sys/dev/pci/pci.c
index adf3daea66fd..034f34e2dde2 100644
--- a/sys/dev/pci/pci.c
+++ b/sys/dev/pci/pci.c
@@ -6535,11 +6535,9 @@ device_t
pci_find_pcie_root_port(device_t dev)
{
struct pci_devinfo *dinfo;
- devclass_t pci_class;
device_t pcib, bus;
- pci_class = devclass_find("pci");
- KASSERT(device_get_devclass(device_get_parent(dev)) == pci_class,
+ KASSERT(is_pci_device(dev),
("%s: non-pci device %s", __func__, device_get_nameunit(dev)));
/*
@@ -6555,11 +6553,7 @@ pci_find_pcie_root_port(device_t dev)
KASSERT(pcib != NULL, ("%s: null bridge of %s", __func__,
device_get_nameunit(bus)));
- /*
- * pcib's parent must be a PCI bus for this to be a
- * PCI-PCI bridge.
- */
- if (device_get_devclass(device_get_parent(pcib)) != pci_class)
+ if (!is_pci_device(pcib))
return (NULL);
dinfo = device_get_ivars(pcib);
diff --git a/sys/dev/pci/vga_pci.c b/sys/dev/pci/vga_pci.c
index 39b2fcab67b4..72c93e201d96 100644
--- a/sys/dev/pci/vga_pci.c
+++ b/sys/dev/pci/vga_pci.c
@@ -111,8 +111,7 @@ vga_pci_is_boot_display(device_t dev)
*/
pcib = device_get_parent(device_get_parent(dev));
- if (device_get_devclass(device_get_parent(pcib)) ==
- devclass_find("pci")) {
+ if (is_pci_device(pcib)) {
/*
* The parent bridge is a PCI-to-PCI bridge: check the
* value of the "VGA Enable" bit.
@@ -186,8 +185,7 @@ vga_pci_map_bios(device_t dev, size_t *size)
#endif
pcib = device_get_parent(device_get_parent(dev));
- if (device_get_devclass(device_get_parent(pcib)) ==
- devclass_find("pci")) {
+ if (is_pci_device(pcib)) {
/*
* The parent bridge is a PCI-to-PCI bridge: check the
* value of the "VGA Enable" bit.