diff --git a/include/dm/device.h b/include/dm/device.h index e54cb6bca41..add67f9ec06 100644 --- a/include/dm/device.h +++ b/include/dm/device.h @@ -1005,7 +1005,8 @@ int dev_enable_by_path(const char *path); */ static inline bool device_is_on_pci_bus(const struct udevice *dev) { - return dev->parent && device_get_uclass_id(dev->parent) == UCLASS_PCI; + return CONFIG_IS_ENABLED(PCI) && dev->parent && + device_get_uclass_id(dev->parent) == UCLASS_PCI; } /**