summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorBjorn Helgaas <bjorn.helgaas@hp.com>2010-03-22 23:34:05 +0100
committerJesse Barnes <jbarnes@virtuousgeek.org>2010-03-25 16:51:35 +0100
commitf967a44343e407811898ddac97abc69b293e9810 (patch)
treef7707ffe10dd10efe3d50670c1252d819aef6534 /drivers
parentPCI quirk: Disable MSI on VIA K8T890 systems (diff)
downloadlinux-f967a44343e407811898ddac97abc69b293e9810.tar.xz
linux-f967a44343e407811898ddac97abc69b293e9810.zip
PCI: don't say we claimed a resource if we failed
pci_claim_resource() can fail, so pay attention and only claim success when it actually succeeded. If pci_claim_resource() fails, it prints a useful diagnostic. Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/pci/quirks.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
index f6bbb9c89e3d..3ea0b29c0104 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);
}
}