diff options
author | Bjorn Helgaas <bhelgaas@google.com> | 2014-07-08 16:00:42 -0600 |
---|---|---|
committer | Bjorn Helgaas <bhelgaas@google.com> | 2014-07-08 16:29:08 -0600 |
commit | 947788359527d9598356c274c50522e0f6d0ad0f (patch) | |
tree | 05b0820ac69c2727bc898c503ce107c5a4aa9b05 /drivers/pci | |
parent | 28f6dbe2c669c6a02c04c8ece21cafbcb20370ab (diff) | |
download | blackbird-op-linux-947788359527d9598356c274c50522e0f6d0ad0f.tar.gz blackbird-op-linux-947788359527d9598356c274c50522e0f6d0ad0f.zip |
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: Bjorn Helgaas <bhelgaas@google.com>
Diffstat (limited to 'drivers/pci')
-rw-r--r-- | drivers/pci/setup-res.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/drivers/pci/setup-res.c b/drivers/pci/setup-res.c index 532dc540dc5d..74eb6febdf87 100644 --- a/drivers/pci/setup-res.c +++ b/drivers/pci/setup-res.c @@ -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; @@ -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, @@ -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; |