diff mbox

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

Message ID 1440318781-11321-2-git-send-email-bmeng.cn@gmail.com
State Superseded
Delegated to: Simon Glass
Headers show

Commit Message

Bin Meng Aug. 23, 2015, 8:32 a.m. UTC
If there is no pci device listed in the device treee,
don't bother scanning the device tree.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>

---
Simon, I see the following v2 patches were applied, but don't see
you replied the patch thread to mention it's been applied.
 - x86: fsp: Call fsp_init_phase_pci() in pci_uclass_post_probe()
 - fdtdec: Fix possible infinite loop in fdtdec_get_pci_vendev()
 - dm: pci: Save devfn without bus number in pci_uclass_child_post_bind()

I assume these patches look good, so I don't include those patches
in the v3 series. Let me know if there is any issue.

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

Bin Meng Aug. 23, 2015, 12:27 p.m. UTC | #1
On Sun, Aug 23, 2015 at 4:32 PM, Bin Meng <bmeng.cn@gmail.com> wrote:
> If there is no pci device listed in the device treee,
> don't bother scanning the device tree.
>
> Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
>

Sorry, just found a typo of this patch and sent a respin one @
http://patchwork.ozlabs.org/patch/509849/

Regards,
Bin
diff mbox

Patch

diff --git a/drivers/pci/pci-uclass.c b/drivers/pci/pci-uclass.c
index 2d12344..b82ab4a 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 treee,
+	 * 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.