git: 6a043d0814a2 - main - LinuxKPI: Check the devclass of the parent device in dev_is_pci

From: John Baldwin <jhb_at_FreeBSD.org>
Date: Mon, 18 May 2026 18:53:29 UTC
The branch main has been updated by jhb:

URL: https://cgit.FreeBSD.org/src/commit/?id=6a043d0814a29e756f5d26e7b59a360e1d6dfa45

commit 6a043d0814a29e756f5d26e7b59a360e1d6dfa45
Author:     John Baldwin <jhb@FreeBSD.org>
AuthorDate: 2026-05-18 18:44:00 +0000
Commit:     John Baldwin <jhb@FreeBSD.org>
CommitDate: 2026-05-18 18:44:00 +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
---
 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 5cd87ff091bc..a6ddc02d1947 100644
--- a/sys/compat/linuxkpi/common/include/linux/pci.h
+++ b/sys/compat/linuxkpi/common/include/linux/pci.h
@@ -399,8 +399,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