mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-10 15:14:43 +00:00
dm: core: Tweak device_is_on_pci_bus() for code size
This function cannot return true if PCI is not enabled, since no PCI devices will have been bound. Add a check for this to reduce code size where it is used. Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
parent
7f5ff034c3
commit
61fc132051
1 changed files with 2 additions and 1 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue