diff options
author | Simon Glass <sjg@chromium.org> | 2015-11-26 19:51:28 -0700 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2015-12-01 06:26:37 -0700 |
commit | c4f32bb24857b2a3950b4c804c1d6302520c81ae (patch) | |
tree | 260fb2097f4183f55db7a31ed9efb98d3c9da8d8 /common/cmd_pci.c | |
parent | 32ec5b344b651af15eb42add80c7480154fcd4e3 (diff) | |
download | u-boot-imx-c4f32bb24857b2a3950b4c804c1d6302520c81ae.zip u-boot-imx-c4f32bb24857b2a3950b4c804c1d6302520c81ae.tar.gz u-boot-imx-c4f32bb24857b2a3950b4c804c1d6302520c81ae.tar.bz2 |
pci: Move PCI header output code into its own function
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>
Diffstat (limited to 'common/cmd_pci.c')
-rw-r--r-- | common/cmd_pci.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/common/cmd_pci.c b/common/cmd_pci.c index 963dc10..8742fac 100644 --- a/common/cmd_pci.c +++ b/common/cmd_pci.c @@ -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; |