Skip to content

Commit

Permalink
PCI: Return conventional error values from pci_revert_fw_address()
Browse files Browse the repository at this point in the history
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: Bjorn Helgaas <[email protected]>
  • Loading branch information
bjorn-helgaas committed Jul 8, 2014
1 parent 28f6dbe commit 9477883
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions drivers/pci/setup-res.c
Original file line number Diff line number Diff line change
Expand Up @@ -166,11 +166,10 @@ static int pci_revert_fw_address(struct resource *res, struct pci_dev *dev,
{
struct resource *root, *conflict;
resource_size_t fw_addr, start, end;
int ret = 0;

fw_addr = pcibios_retrieve_fw_addr(dev, resno);
if (!fw_addr)
return 1;
return -ENOMEM;

start = res->start;
end = res->end;
Expand All @@ -189,14 +188,13 @@ static int pci_revert_fw_address(struct resource *res, struct pci_dev *dev,
resno, res);
conflict = request_resource_conflict(root, res);
if (conflict) {
dev_info(&dev->dev,
"BAR %d: %pR conflicts with %s %pR\n", resno,
res, conflict->name, conflict);
dev_info(&dev->dev, "BAR %d: %pR conflicts with %s %pR\n",
resno, res, conflict->name, conflict);
res->start = start;
res->end = end;
ret = 1;
return -EBUSY;
}
return ret;
return 0;
}

static int __pci_assign_resource(struct pci_bus *bus, struct pci_dev *dev,
Expand Down Expand Up @@ -305,7 +303,7 @@ int pci_assign_resource(struct pci_dev *dev, int resno)
if (ret < 0)
ret = pci_revert_fw_address(res, dev, resno, size);

if (ret)
if (ret < 0)
return ret;

res->flags &= ~IORESOURCE_UNSET;
Expand Down

0 comments on commit 9477883

Please sign in to comment.