[U-Boot] [PATCH 12/14] pci: Move PCI header output code into its own function

Bin Meng bmeng.cn at gmail.com
Fri Nov 13 08:11:26 CET 2015


On Fri, Nov 13, 2015 at 5:45 AM, Simon Glass <sjg at chromium.org> wrote:
> We want to share this code with the driver model version, so put it in a
> separate function.
>
> Signed-off-by: Simon Glass <sjg at chromium.org>
> ---
>
>  common/cmd_pci.c | 17 +++++++++++------
>  1 file changed, 11 insertions(+), 6 deletions(-)
>
> diff --git a/common/cmd_pci.c b/common/cmd_pci.c
> index 3d09beb..6303bed 100644
> --- a/common/cmd_pci.c
> +++ b/common/cmd_pci.c
> @@ -199,6 +199,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");
> +       }
> +}
> +
>  /*
>   * Subroutine:  pci_header_show_brief
>   *
> @@ -250,12 +260,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++) {
>                 HeaderType = 0;
> --

Reviewed-by: Bin Meng <bmeng.cn at gmail.com>


More information about the U-Boot mailing list