Fix pci_claim_resource

Instead of starting from the iomem or ioport roots, start from the
parent bus' resources. This fixes a bug where child resources would
appear above their parents resources if they had the same size.

Signed-off-by: Matthew Wilcox <willy@linux.intel.com>
Tested-by: Andrew Patterson <andrew.patterson@hp.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by Matthew Wilcox and committed by Linus Torvalds cebd78a8 7cc47662

+2 -2
+2 -2
drivers/pci/setup-res.c
··· 99 99 int pci_claim_resource(struct pci_dev *dev, int resource) 100 100 { 101 101 struct resource *res = &dev->resource[resource]; 102 - struct resource *root = NULL; 102 + struct resource *root; 103 103 char *dtype = resource < PCI_BRIDGE_RESOURCES ? "device" : "bridge"; 104 104 int err; 105 105 106 - root = pcibios_select_root(dev, res); 106 + root = pci_find_parent_resource(dev, res); 107 107 108 108 err = -EINVAL; 109 109 if (root != NULL)