From patchwork Wed Oct 7 23:37:31 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Estevam X-Patchwork-Id: 527508 X-Patchwork-Delegate: sjg@chromium.org 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 2F023140D87 for ; Thu, 8 Oct 2015 10:38:08 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=MgKfRFqg; dkim-atps=neutral Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id A5DC24B816; Thu, 8 Oct 2015 01:38:04 +0200 (CEST) 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 TBuVLRim5DXw; Thu, 8 Oct 2015 01:38:04 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id C3A9A4B718; Thu, 8 Oct 2015 01:38:03 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id F21514B718 for ; Thu, 8 Oct 2015 01:37:58 +0200 (CEST) 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 jdgzeLyI5dW4 for ; Thu, 8 Oct 2015 01:37:58 +0200 (CEST) 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-yk0-f181.google.com (mail-yk0-f181.google.com [209.85.160.181]) by theia.denx.de (Postfix) with ESMTPS id 570234B67F for ; Thu, 8 Oct 2015 01:37:53 +0200 (CEST) Received: by ykdz138 with SMTP id z138so33837918ykd.2 for ; Wed, 07 Oct 2015 16:37:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=eZl5Hjy44XT9e4+tf1stFGASmFvE4m0WSLCZfnSKmd8=; b=MgKfRFqge/wpZ1f8uIZDu+hXHJIEpNbVXBpcHE4SmZNmrNo5ZLFdkHD/gf5cv3icRk sZdfSFu14e+NlPbqcx5xrTJvaYhmP4FiO5wU9OY7ZD5bMauappIh8IJI3QoZXPICCHS+ gOb4O4BUtbmL/t9aZjQTlOL426ZOSnLksqRDRJ2nQP2QEewZwaGuvoQSzN8Mqv4za/2z g1mj6lfZIkB2j1HPHipEuVz56Qw7iVmxsAmYtLGaI0TH/ZQUW9dUbmGSDKksKbVD2wYF MU5BYnn4MKu6OrNxbg6Mg/uZjHiUzUpk0fr/5cc+8fs3yazlt5RcQWSrJbHcAkhiPDPU gerg== X-Received: by 10.129.109.214 with SMTP id i205mr3145791ywc.179.1444261072247; Wed, 07 Oct 2015 16:37:52 -0700 (PDT) Received: from localhost.localdomain ([187.64.230.127]) by smtp.gmail.com with ESMTPSA id m127sm18132484ywe.8.2015.10.07.16.37.50 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 07 Oct 2015 16:37:51 -0700 (PDT) From: Fabio Estevam To: sjg@chromium.org Date: Wed, 7 Oct 2015 20:37:31 -0300 Message-Id: <1444261051-5468-1-git-send-email-festevam@gmail.com> X-Mailer: git-send-email 1.9.1 Cc: Fabio Estevam , trini@konsulko.com, u-boot@lists.denx.de Subject: [U-Boot] [PATCH] cmd_pci: Check for VendorID earlier 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" From: Fabio Estevam Since commit ff3e077bd2 ("dm: pci: Add a uclass for PCI") the following error message is seen: => pci 0 Scanning PCI devices on bus 0 BusDevFun VendorId DeviceId Device Class Sub-Class diff --git a/common/cmd_pci.c b/common/cmd_pci.c index dcecef8..92dc643 100644 --- a/common/cmd_pci.c +++ b/common/cmd_pci.c @@ -77,10 +77,10 @@ void pciinfo(int BusNum, int ShortPCIListing) ret = pci_read_config_word(dev, PCI_VENDOR_ID, &VendorID); - if (ret) - goto error; if ((VendorID == 0xFFFF) || (VendorID == 0x0000)) continue; + if (ret) + goto error; if (!Function) pci_read_config_byte(dev, PCI_HEADER_TYPE, &HeaderType);