diff mbox

[U-Boot,v4,1/4] dm: pci: Optimize pci_uclass_post_bind()

Message ID 1440404044-9154-2-git-send-email-bmeng.cn@gmail.com
State Accepted
Delegated to: Simon Glass
Headers show

Commit Message

Bin Meng Aug. 24, 2015, 8:14 a.m. UTC
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>

---

Changes in v4: None
Changes in v3:
- Rebase on u-boot-x86/master
- Drop v2 patches which were already applied

 drivers/pci/pci-uclass.c | 7 +++++++
 1 file changed, 7 insertions(+)

Comments

Simon Glass Aug. 26, 2015, 2:55 p.m. UTC | #1
On 24 August 2015 at 01:14, Bin Meng <bmeng.cn@gmail.com> wrote:
> 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>
>
> ---
>
> Changes in v4: None
> Changes in v3:
> - Rebase on u-boot-x86/master
> - Drop v2 patches which were already applied
>
>  drivers/pci/pci-uclass.c | 7 +++++++
>  1 file changed, 7 insertions(+)

I'd like to get this series in to correct your serial problem.

Applied to u-boot-x86, thanks!
diff mbox

Patch

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.