diff options
Diffstat (limited to 'drivers/pci')
-rw-r--r-- | drivers/pci/setup-res.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/pci/setup-res.c b/drivers/pci/setup-res.c index 2473f091a9cc..3bdac9dc4a88 100644 --- a/drivers/pci/setup-res.c +++ b/drivers/pci/setup-res.c | |||
@@ -213,9 +213,10 @@ static int __pci_assign_resource(struct pci_bus *bus, struct pci_dev *dev, | |||
213 | ret = pci_bus_alloc_resource(bus, res, size, align, min, | 213 | ret = pci_bus_alloc_resource(bus, res, size, align, min, |
214 | IORESOURCE_PREFETCH | IORESOURCE_MEM_64, | 214 | IORESOURCE_PREFETCH | IORESOURCE_MEM_64, |
215 | pcibios_align_resource, dev); | 215 | pcibios_align_resource, dev); |
216 | if (ret == 0) | ||
217 | return 0; | ||
216 | 218 | ||
217 | if (ret < 0 && | 219 | if ((res->flags & (IORESOURCE_PREFETCH | IORESOURCE_MEM_64)) == |
218 | (res->flags & (IORESOURCE_PREFETCH | IORESOURCE_MEM_64)) == | ||
219 | (IORESOURCE_PREFETCH | IORESOURCE_MEM_64)) { | 220 | (IORESOURCE_PREFETCH | IORESOURCE_MEM_64)) { |
220 | /* | 221 | /* |
221 | * That failed. | 222 | * That failed. |
@@ -225,10 +226,11 @@ static int __pci_assign_resource(struct pci_bus *bus, struct pci_dev *dev, | |||
225 | ret = pci_bus_alloc_resource(bus, res, size, align, min, | 226 | ret = pci_bus_alloc_resource(bus, res, size, align, min, |
226 | IORESOURCE_PREFETCH, | 227 | IORESOURCE_PREFETCH, |
227 | pcibios_align_resource, dev); | 228 | pcibios_align_resource, dev); |
229 | if (ret == 0) | ||
230 | return 0; | ||
228 | } | 231 | } |
229 | 232 | ||
230 | if (ret < 0 && | 233 | if (res->flags & (IORESOURCE_PREFETCH | IORESOURCE_MEM_64)) { |
231 | (res->flags & (IORESOURCE_PREFETCH | IORESOURCE_MEM_64))) { | ||
232 | /* | 234 | /* |
233 | * That failed. | 235 | * That failed. |
234 | * | 236 | * |