aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/vnic
diff options
context:
space:
mode:
authorJohn Baldwin <jhb@FreeBSD.org>2026-05-18 18:52:23 +0000
committerJohn Baldwin <jhb@FreeBSD.org>2026-05-18 18:52:23 +0000
commit6dc813301a173e2e1993c3064df162e6218c1231 (patch)
tree8416dfcfe0481ac2a06eb075cda5f9a1414c77e3 /sys/dev/vnic
parentffcf5e356644252f2f6c89ba01057af45c216559 (diff)
sys: Use is_pci_device instead of direct comparisons to devclasses
Reviewed by: bz Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D56997
Diffstat (limited to 'sys/dev/vnic')
-rw-r--r--sys/dev/vnic/thunder_bgx_fdt.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/sys/dev/vnic/thunder_bgx_fdt.c b/sys/dev/vnic/thunder_bgx_fdt.c
index 20a5b54f7448..d8c5459f2914 100644
--- a/sys/dev/vnic/thunder_bgx_fdt.c
+++ b/sys/dev/vnic/thunder_bgx_fdt.c
@@ -285,11 +285,9 @@ bgx_fdt_traverse_nodes(uint8_t unit, phandle_t start, char *name,
static device_t
bgx_find_root_pcib(device_t dev)
{
- 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)));
/* Walk the bridge hierarchy until we find a non-PCI device */
@@ -298,9 +296,6 @@ bgx_find_root_pcib(device_t dev)
KASSERT(bus != NULL, ("%s: null parent of %s", __func__,
device_get_nameunit(dev)));
- if (device_get_devclass(bus) != pci_class)
- return (NULL);
-
pcib = device_get_parent(bus);
KASSERT(pcib != NULL, ("%s: null bridge of %s", __func__,
device_get_nameunit(bus)));
@@ -309,7 +304,7 @@ bgx_find_root_pcib(device_t dev)
* If the parent of this PCIB is not PCI
* then we found our root PCIB.
*/
- if (device_get_devclass(device_get_parent(pcib)) != pci_class)
+ if (!is_pci_device(pcib))
return (pcib);
dev = pcib;