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>
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 @@
 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.