From patchwork Mon Mar 22 22:34:05 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Helgaas X-Patchwork-Id: 87522 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o2MMY9JF020657 for ; Mon, 22 Mar 2010 22:34:10 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754905Ab0CVWeI (ORCPT ); Mon, 22 Mar 2010 18:34:08 -0400 Received: from g4t0016.houston.hp.com ([15.201.24.19]:16374 "EHLO g4t0016.houston.hp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754820Ab0CVWeH (ORCPT ); Mon, 22 Mar 2010 18:34:07 -0400 Received: from g4t0018.houston.hp.com (g4t0018.houston.hp.com [16.234.32.27]) by g4t0016.houston.hp.com (Postfix) with ESMTP id B9C2E14017; Mon, 22 Mar 2010 22:34:05 +0000 (UTC) Received: from ldl (ldl.fc.hp.com [15.11.146.30]) by g4t0018.houston.hp.com (Postfix) with ESMTP id 966F8100D9; Mon, 22 Mar 2010 22:34:05 +0000 (UTC) Received: from localhost (ldl.fc.hp.com [127.0.0.1]) by ldl (Postfix) with ESMTP id 7C2DDCF0027; Mon, 22 Mar 2010 16:34:05 -0600 (MDT) Received: from ldl ([127.0.0.1]) by localhost (ldl.fc.hp.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id WFZ2wV3AcI1l; Mon, 22 Mar 2010 16:34:05 -0600 (MDT) Received: from eh.fc.hp.com (eh.fc.hp.com [15.11.146.105]) by ldl (Postfix) with ESMTP id 6645CCF0021; Mon, 22 Mar 2010 16:34:05 -0600 (MDT) Received: from bob.kio (localhost [127.0.0.1]) by eh.fc.hp.com (Postfix) with ESMTP id 28EF1262A3; Mon, 22 Mar 2010 16:34:05 -0600 (MDT) Subject: [PATCH 1/3] PCI: don't say we claimed a resource if we failed To: Jesse Barnes From: Bjorn Helgaas Cc: David Howells , linux-pci@vger.kernel.org Date: Mon, 22 Mar 2010 16:34:05 -0600 Message-ID: <20100322223405.11979.49633.stgit@bob.kio> User-Agent: StGit/0.15 MIME-Version: 1.0 Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Mon, 22 Mar 2010 22:34:11 +0000 (UTC) diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c index 81d19d5..806b5c2 100644 --- a/drivers/pci/quirks.c +++ b/drivers/pci/quirks.c @@ -368,8 +368,9 @@ static void __devinit quirk_io_region(struct pci_dev *dev, unsigned region, bus_region.end = res->end; pcibios_bus_to_resource(dev, res, &bus_region); - pci_claim_resource(dev, nr); - dev_info(&dev->dev, "quirk: %pR claimed by %s\n", res, name); + if (pci_claim_resource(dev, nr) == 0) + dev_info(&dev->dev, "quirk: %pR claimed by %s\n", + res, name); } }