diff options
author | Bin Meng <bmeng.cn@gmail.com> | 2015-08-24 01:14:01 -0700 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2015-08-26 07:54:17 -0700 |
commit | 1887ed3ad6509a4ce411b7981dd27515e0c44bb7 (patch) | |
tree | 4286417dc632afe5eb84acfd7b1c29315804b9ed /drivers/pci | |
parent | 3242998e24b899540790077f8bbde447f4c039c6 (diff) | |
download | u-boot-imx-1887ed3ad6509a4ce411b7981dd27515e0c44bb7.zip u-boot-imx-1887ed3ad6509a4ce411b7981dd27515e0c44bb7.tar.gz u-boot-imx-1887ed3ad6509a4ce411b7981dd27515e0c44bb7.tar.bz2 |
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 <bmeng.cn@gmail.com>
Acked-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'drivers/pci')
-rw-r--r-- | drivers/pci/pci-uclass.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/pci/pci-uclass.c b/drivers/pci/pci-uclass.c index 2d12344..b25298f 100644 --- a/drivers/pci/pci-uclass.c +++ b/drivers/pci/pci-uclass.c @@ -632,6 +632,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 * mentioned in the device tree. |