diff options
Diffstat (limited to 'drivers/pci/pci.c')
-rw-r--r-- | drivers/pci/pci.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c index f36b46806513..e3145f020271 100644 --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c | |||
@@ -382,8 +382,12 @@ pci_find_parent_resource(const struct pci_dev *dev, struct resource *res) | |||
382 | continue; /* Wrong type */ | 382 | continue; /* Wrong type */ |
383 | if (!((res->flags ^ r->flags) & IORESOURCE_PREFETCH)) | 383 | if (!((res->flags ^ r->flags) & IORESOURCE_PREFETCH)) |
384 | return r; /* Exact match */ | 384 | return r; /* Exact match */ |
385 | if ((res->flags & IORESOURCE_PREFETCH) && !(r->flags & IORESOURCE_PREFETCH)) | 385 | /* We can't insert a non-prefetch resource inside a prefetchable parent .. */ |
386 | best = r; /* Approximating prefetchable by non-prefetchable */ | 386 | if (r->flags & IORESOURCE_PREFETCH) |
387 | continue; | ||
388 | /* .. but we can put a prefetchable resource inside a non-prefetchable one */ | ||
389 | if (!best) | ||
390 | best = r; | ||
387 | } | 391 | } |
388 | return best; | 392 | return best; |
389 | } | 393 | } |