LinuxKPI: Check the devclass of the parent device in dev_is_pci

Reviewed by:	bz
Fixes:		c41d83548b ("LinuxKPI: pci.h add more defines and functions")
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D57066
This commit is contained in:
John Baldwin
2026-05-18 14:44:00 -04:00
parent 701d7be6e4
commit 6a043d0814
@@ -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