diff mbox

[U-Boot,v2,11/13] pci: Move PCI header output code into its own function

Message ID 1448148508-17207-12-git-send-email-sjg@chromium.org
State Superseded
Delegated to: Simon Glass
Headers show

Commit Message

Simon Glass Nov. 21, 2015, 11:28 p.m. UTC
We want to share this code with the driver model version, so put it in a
separate function.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
---

Changes in v2: None

 common/cmd_pci.c | 17 +++++++++++------
 1 file changed, 11 insertions(+), 6 deletions(-)
diff mbox

Patch

diff --git a/common/cmd_pci.c b/common/cmd_pci.c
index bfebc80..694f1f9 100644
--- a/common/cmd_pci.c
+++ b/common/cmd_pci.c
@@ -195,6 +195,16 @@  void pci_header_show(pci_dev_t dev)
     }
 }
 
+void pciinfo_header(int busnum, bool short_listing)
+{
+	printf("Scanning PCI devices on bus %d\n", busnum);
+
+	if (short_listing) {
+		printf("BusDevFun  VendorId   DeviceId   Device Class       Sub-Class\n");
+		printf("_____________________________________________________________\n");
+	}
+}
+
 /**
  * pci_header_show_brief() - Show the short-form PCI device header
  *
@@ -240,12 +250,7 @@  void pciinfo(int bus_num, int short_pci_listing)
 	if (!hose)
 		return;
 
-	printf("Scanning PCI devices on bus %d\n", bus_num);
-
-	if (short_pci_listing) {
-		printf("BusDevFun  VendorId   DeviceId   Device Class       Sub-Class\n");
-		printf("_____________________________________________________________\n");
-	}
+	pciinfo_header(bus_num, short_pci_listing);
 
 	for (device = 0; device < PCI_MAX_PCI_DEVICES; device++) {
 		header_type = 0;