diff options
author | Bjorn Helgaas <bhelgaas@google.com> | 2014-07-08 18:00:42 -0400 |
---|---|---|
committer | Bjorn Helgaas <bhelgaas@google.com> | 2014-07-08 18:29:08 -0400 |
commit | 947788359527d9598356c274c50522e0f6d0ad0f (patch) | |
tree | 05b0820ac69c2727bc898c503ce107c5a4aa9b05 /drivers/pci/setup-res.c | |
parent | 28f6dbe2c669c6a02c04c8ece21cafbcb20370ab (diff) |
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/setup-res.c')
-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, | |||
166 | { | 166 | { |
167 | struct resource *root, *conflict; | 167 | struct resource *root, *conflict; |
168 | resource_size_t fw_addr, start, end; | 168 | resource_size_t fw_addr, start, end; |
169 | int ret = 0; | ||
170 | 169 | ||
171 | fw_addr = pcibios_retrieve_fw_addr(dev, resno); | 170 | fw_addr = pcibios_retrieve_fw_addr(dev, resno); |
172 | if (!fw_addr) | 171 | if (!fw_addr) |
173 | return 1; | 172 | return -ENOMEM; |
174 | 173 | ||
175 | start = res->start; | 174 | start = res->start; |
176 | end = res->end; | 175 | end = res->end; |
@@ -189,14 +188,13 @@ static int pci_revert_fw_address(struct resource *res, struct pci_dev *dev, | |||
189 | resno, res); | 188 | resno, res); |
190 | conflict = request_resource_conflict(root, res); | 189 | conflict = request_resource_conflict(root, res); |
191 | if (conflict) { | 190 | if (conflict) { |
192 | dev_info(&dev->dev, | 191 | dev_info(&dev->dev, "BAR %d: %pR conflicts with %s %pR\n", |
193 | "BAR %d: %pR conflicts with %s %pR\n", resno, | 192 | resno, res, conflict->name, conflict); |
194 | res, conflict->name, conflict); | ||
195 | res->start = start; | 193 | res->start = start; |
196 | res->end = end; | 194 | res->end = end; |
197 | ret = 1; | 195 | return -EBUSY; |
198 | } | 196 | } |
199 | return ret; | 197 | return 0; |
200 | } | 198 | } |
201 | 199 | ||
202 | static int __pci_assign_resource(struct pci_bus *bus, struct pci_dev *dev, | 200 | 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 | if (ret < 0) | 303 | if (ret < 0) |
306 | ret = pci_revert_fw_address(res, dev, resno, size); | 304 | ret = pci_revert_fw_address(res, dev, resno, size); |
307 | 305 | ||
308 | if (ret) | 306 | if (ret < 0) |
309 | return ret; | 307 | return ret; |
310 | 308 | ||
311 | res->flags &= ~IORESOURCE_UNSET; | 309 | res->flags &= ~IORESOURCE_UNSET; |