From patchwork Fri Nov 27 02:51:28 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 549289 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 87FE91401DA for ; Fri, 27 Nov 2015 13:55:29 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=google.com header.i=@google.com header.b=XQn6ifrs; dkim-atps=neutral Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 6B6CD4B890; Fri, 27 Nov 2015 03:55:27 +0100 (CET) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id EuyyKIndwm0Y; Fri, 27 Nov 2015 03:55:26 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 1F79E4B957; Fri, 27 Nov 2015 03:53:30 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 34BBA4B901 for ; Fri, 27 Nov 2015 03:51:49 +0100 (CET) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id WPG1b4Z4A3XO for ; Fri, 27 Nov 2015 03:51:49 +0100 (CET) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mail-ob0-f176.google.com (mail-ob0-f176.google.com [209.85.214.176]) by theia.denx.de (Postfix) with ESMTPS id 2770D4B8F8 for ; Fri, 27 Nov 2015 03:51:44 +0100 (CET) Received: by obbbj7 with SMTP id bj7so73550950obb.1 for ; Thu, 26 Nov 2015 18:51:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=+mTonBqYu9AK3cHtfL65hjtkp84utCkzRrR1i0I/qzg=; b=XQn6ifrsOuB2peLNGo57MENf1zLFmNLrrmjE7TvqiBd5Lw6+vm3Ry6l39vbI4mBIz9 glZC3MEC+QSO2DISu3Jypd0tPBjFtjs+mqRpAgJQKOfdZTuOAh2FuxKKtmPkb+DFJFKy xR6opkv3rvZo2VuFQgpDvnVRGxcSspWZE96UVhu4a6Ea4lGS7nNTcrmAwWDyb0z62VyO 7+I7YVtLK8WQiIVEAse3uWGT15xz3bcw58hhffdA4TEn29X2s8ByMcK5sZnzUjU/MYtx 6rYtUTo8wvOBniN30J7Kwxaey3KzaKER7uV9sIlOZ59oHrGiP4qki07gvOU+gHQj13j0 jqEg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=+mTonBqYu9AK3cHtfL65hjtkp84utCkzRrR1i0I/qzg=; b=hujU0Rd36F8CIvJMgSXzgVV3xJx6C6vKOJ1SJM7DRJ/RHrkeQ/tztZpHNg9l+eqM2g 6uh39CyqhhRWOTOcwvq4rONoGd6AvGpHi9P8D/Sk+1PxzZGMWKqMLF7Sidgf+Wv4EwWP d05d4OMMiWZc8utrD+ikuIr0NDSkOKqJ87wcIs9hdcGdErMyxD5F8mF1e6Gnwo4fgW04 q/9HQGz0SyMMtFCWXxh33mV8JX9Tda/TKS8w/plmBvUWkMi9lXx9MCxU0lxLR0W4ignp aFcisrCzd1zWuCHc6LkaCUCkITm4bsEn50vqXn1Zl7FDfhc8gRGP4EU5kwabDkmh5/fT CWIA== X-Gm-Message-State: ALoCoQlwqT3D6aUerSsw1e9R4PaBUO36bNp4w9uMyqAa23yDM6RbqmkqopHjCWp+jOdryqjHa1fL X-Received: by 10.60.246.102 with SMTP id xv6mr32873819oec.55.1448592702853; Thu, 26 Nov 2015 18:51:42 -0800 (PST) Received: from kaki.bld.corp.google.com ([2620:0:1005:1100:28fb:2b52:afad:5fc9]) by smtp.gmail.com with ESMTPSA id a77sm14427343oic.8.2015.11.26.18.51.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 26 Nov 2015 18:51:39 -0800 (PST) Received: by kaki.bld.corp.google.com (Postfix, from userid 121222) id AB91B221868; Thu, 26 Nov 2015 19:51:37 -0700 (MST) From: Simon Glass To: U-Boot Mailing List Date: Thu, 26 Nov 2015 19:51:28 -0700 Message-Id: <1448592690-14911-12-git-send-email-sjg@chromium.org> X-Mailer: git-send-email 2.6.0.rc2.230.g3dd15c0 In-Reply-To: <1448592690-14911-1-git-send-email-sjg@chromium.org> References: <1448592690-14911-1-git-send-email-sjg@chromium.org> Subject: [U-Boot] [PATCH v3 11/13] pci: Move PCI header output code into its own function X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.15 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" We want to share this code with the driver model version, so put it in a separate function. Signed-off-by: Simon Glass Reviewed-by: Bin Meng --- Changes in v3: None Changes in v2: None 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 857e3e5..fcda7f6 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;