aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Baldwin <jhb@FreeBSD.org>2026-05-18 18:52:39 +0000
committerJohn Baldwin <jhb@FreeBSD.org>2026-05-18 18:52:39 +0000
commitbe4f245e1e4fe60d43aaff5b11b45f2a9a66a51c (patch)
tree0fca1d4e9546a37ecedd508ffe8cdc005c1f2936
parent6dc813301a173e2e1993c3064df162e6218c1231 (diff)
sys: Use is_pci_device instead of checking device or devclass names
Reviewed by: bz, imp Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D56998
-rw-r--r--sys/dev/sound/pcm/ac97.c2
-rw-r--r--sys/dev/thunderbolt/tb_pcib.c7
2 files changed, 3 insertions, 6 deletions
diff --git a/sys/dev/sound/pcm/ac97.c b/sys/dev/sound/pcm/ac97.c
index 1407d202a0d1..ec742ccbbfaa 100644
--- a/sys/dev/sound/pcm/ac97.c
+++ b/sys/dev/sound/pcm/ac97.c
@@ -628,7 +628,7 @@ ac97_initmixer(struct ac97_info *codec)
}
pdev = codec->dev;
- while (strcmp(device_get_name(device_get_parent(pdev)), "pci") != 0) {
+ while (!is_pci_device(pdev)) {
/* find the top-level PCI device handler */
pdev = device_get_parent(pdev);
}
diff --git a/sys/dev/thunderbolt/tb_pcib.c b/sys/dev/thunderbolt/tb_pcib.c
index 65ff42e4f831..876722a0076d 100644
--- a/sys/dev/thunderbolt/tb_pcib.c
+++ b/sys/dev/thunderbolt/tb_pcib.c
@@ -548,16 +548,13 @@ tb_pci_probe(device_t dev)
{
struct tb_pcib_ident *n;
device_t parent;
- devclass_t dc;
/*
* This driver is only valid if the parent device is a PCI-PCI
- * bridge. To determine that, check if the grandparent is a
- * PCI bus.
+ * bridge.
*/
parent = device_get_parent(dev);
- dc = device_get_devclass(device_get_parent(parent));
- if (strcmp(devclass_get_name(dc), "pci") != 0)
+ if (!is_pci_device(parent))
return (ENXIO);
if ((n = tb_pcib_find_ident(parent)) != NULL) {