Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f967a443 authored by Bjorn Helgaas's avatar Bjorn Helgaas Committed by Jesse Barnes
Browse files

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: default avatarBjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: default avatarJesse Barnes <jbarnes@virtuousgeek.org>
parent 134b3450
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -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);
	}
}