Commit 94778835 authored by Bjorn Helgaas's avatar Bjorn Helgaas

PCI: Return conventional error values from pci_revert_fw_address()

Previously we returned zero for success or 1 for failure.  This changes
that so we return zero for success or a negative errno for failure.

No functional change.
Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
parent 28f6dbe2
...@@ -166,11 +166,10 @@ static int pci_revert_fw_address(struct resource *res, struct pci_dev *dev, ...@@ -166,11 +166,10 @@ static int pci_revert_fw_address(struct resource *res, struct pci_dev *dev,
{ {
struct resource *root, *conflict; struct resource *root, *conflict;
resource_size_t fw_addr, start, end; resource_size_t fw_addr, start, end;
int ret = 0;
fw_addr = pcibios_retrieve_fw_addr(dev, resno); fw_addr = pcibios_retrieve_fw_addr(dev, resno);
if (!fw_addr) if (!fw_addr)
return 1; return -ENOMEM;
start = res->start; start = res->start;
end = res->end; end = res->end;
...@@ -189,14 +188,13 @@ static int pci_revert_fw_address(struct resource *res, struct pci_dev *dev, ...@@ -189,14 +188,13 @@ static int pci_revert_fw_address(struct resource *res, struct pci_dev *dev,
resno, res); resno, res);
conflict = request_resource_conflict(root, res); conflict = request_resource_conflict(root, res);
if (conflict) { if (conflict) {
dev_info(&dev->dev, dev_info(&dev->dev, "BAR %d: %pR conflicts with %s %pR\n",
"BAR %d: %pR conflicts with %s %pR\n", resno, resno, res, conflict->name, conflict);
res, conflict->name, conflict);
res->start = start; res->start = start;
res->end = end; res->end = end;
ret = 1; return -EBUSY;
} }
return ret; return 0;
} }
static int __pci_assign_resource(struct pci_bus *bus, struct pci_dev *dev, static int __pci_assign_resource(struct pci_bus *bus, struct pci_dev *dev,
...@@ -305,7 +303,7 @@ int pci_assign_resource(struct pci_dev *dev, int resno) ...@@ -305,7 +303,7 @@ int pci_assign_resource(struct pci_dev *dev, int resno)
if (ret < 0) if (ret < 0)
ret = pci_revert_fw_address(res, dev, resno, size); ret = pci_revert_fw_address(res, dev, resno, size);
if (ret) if (ret < 0)
return ret; return ret;
res->flags &= ~IORESOURCE_UNSET; res->flags &= ~IORESOURCE_UNSET;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment