]> git.ipfire.org Git - people/ms/u-boot.git/commitdiff
pci: Move PCI header output code into its own function
authorSimon Glass <sjg@chromium.org>
Fri, 27 Nov 2015 02:51:28 +0000 (19:51 -0700)
committerSimon Glass <sjg@chromium.org>
Tue, 1 Dec 2015 13:26:37 +0000 (06:26 -0700)
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>
common/cmd_pci.c

index 963dc107b0688afd98ecea72435eb2a049ea6eca..8742facd888caa4536a3c292749052d72e14e6c9 100644 (file)
@@ -200,6 +200,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
  *
@@ -245,12 +255,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;