From: Bin Meng Date: Mon, 24 Aug 2015 08:14:01 +0000 (-0700) Subject: dm: pci: Optimize pci_uclass_post_bind() X-Git-Tag: KARO-TX6-2015-09-18~129 X-Git-Url: https://git.kernelconcepts.de/?p=karo-tx-uboot.git;a=commitdiff_plain;h=01ec422665b32191b940a355ebc6bb107fa9e8e7 dm: pci: Optimize pci_uclass_post_bind() If there is no pci device listed in the device tree, don't bother scanning the device tree. Signed-off-by: Bin Meng Acked-by: Simon Glass --- diff --git a/drivers/pci/pci-uclass.c b/drivers/pci/pci-uclass.c index 2d12344ae2..b25298fb5e 100644 --- a/drivers/pci/pci-uclass.c +++ b/drivers/pci/pci-uclass.c @@ -631,6 +631,13 @@ error: static int pci_uclass_post_bind(struct udevice *bus) { + /* + * If there is no pci device listed in the device tree, + * don't bother scanning the device tree. + */ + if (bus->of_offset == -1) + return 0; + /* * Scan the device tree for devices. This does not probe the PCI bus, * as this is not permitted while binding. It just finds devices