git: 10f33a860388 - stable/14 - LinuxKPI: Check the devclass of the parent device in dev_is_pci

From: John Baldwin <jhb_at_FreeBSD.org>
Date: Tue, 23 Jun 2026 19:11:35 UTC
The branch stable/14 has been updated by jhb:

URL: https://cgit.FreeBSD.org/src/commit/?id=10f33a86038833df9971471960423105325e33f2

commit 10f33a86038833df9971471960423105325e33f2
Author:     John Baldwin <jhb@FreeBSD.org>
AuthorDate: 2026-05-18 18:44:00 +0000
Commit:     John Baldwin <jhb@FreeBSD.org>
CommitDate: 2026-06-23 16:08:31 +0000

    LinuxKPI: Check the devclass of the parent device in dev_is_pci
    
    Reviewed by:    bz
    Fixes:          c41d83548b6c ("LinuxKPI: pci.h add more defines and functions")
    Sponsored by:   Chelsio Communications
    Differential Revision:  https://reviews.freebsd.org/D57066
    (cherry picked from commit 6a043d0814a29e756f5d26e7b59a360e1d6dfa45)
---
 sys/compat/linuxkpi/common/include/linux/pci.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sys/compat/linuxkpi/common/include/linux/pci.h b/sys/compat/linuxkpi/common/include/linux/pci.h
index 381ad65febe5..247057f0fedf 100644
--- a/sys/compat/linuxkpi/common/include/linux/pci.h
+++ b/sys/compat/linuxkpi/common/include/linux/pci.h
@@ -384,8 +384,8 @@ int _lkpi_pci_enable_msi_range(struct pci_dev *pdev, int minvec, int maxvec);
 static inline bool
 dev_is_pci(struct device *dev)
 {
-
-	return (device_get_devclass(dev->bsddev) == devclass_find("pci"));
+	return (device_get_devclass(device_get_parent(dev->bsddev)) ==
+	    devclass_find("pci"));
 }
 
 static inline uint16_t