]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
dm: pci: Optimize pci_uclass_post_bind()
authorBin Meng <bmeng.cn@gmail.com>
Mon, 24 Aug 2015 08:14:01 +0000 (01:14 -0700)
committerLothar Waßmann <LW@KARO-electronics.de>
Thu, 10 Sep 2015 09:29:48 +0000 (11:29 +0200)
If there is no pci device listed in the device tree,
don't bother scanning the device tree.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Acked-by: Simon Glass <sjg@chromium.org>
drivers/pci/pci-uclass.c

index 2d12344ae2713be17603fadc16dabd001d4b136c..b25298fb5e9cec04a8a5e383206521049e8c18c3 100644 (file)
@@ -631,6 +631,13 @@ error:
 
 static int pci_uclass_post_bind(struct udevice *bus)
 {
 
 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
        /*
         * Scan the device tree for devices. This does not probe the PCI bus,
         * as this is not permitted while binding. It just finds devices