aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci/setup-res.c
diff options
context:
space:
mode:
authorMatthew Wilcox <willy@linux.intel.com>2009-06-17 16:33:33 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2009-06-17 17:04:42 -0400
commitcebd78a8c5624b5cf04c39c3335a5fc8670a7b69 (patch)
tree426b2ef97ee950e11e231fff1286ae06cf1f3423 /drivers/pci/setup-res.c
parent7cc47662197b3050a974a6c6aed52291bb38ded0 (diff)
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>
Diffstat (limited to 'drivers/pci/setup-res.c')
-rw-r--r--drivers/pci/setup-res.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/pci/setup-res.c b/drivers/pci/setup-res.c
index 3039fcb86afc..12403516776a 100644
--- a/drivers/pci/setup-res.c
+++ b/drivers/pci/setup-res.c
@@ -99,11 +99,11 @@ void pci_update_resource(struct pci_dev *dev, int resno)
99int pci_claim_resource(struct pci_dev *dev, int resource) 99int pci_claim_resource(struct pci_dev *dev, int resource)
100{ 100{
101 struct resource *res = &dev->resource[resource]; 101 struct resource *res = &dev->resource[resource];
102 struct resource *root = NULL; 102 struct resource *root;
103 char *dtype = resource < PCI_BRIDGE_RESOURCES ? "device" : "bridge"; 103 char *dtype = resource < PCI_BRIDGE_RESOURCES ? "device" : "bridge";
104 int err; 104 int err;
105 105
106 root = pcibios_select_root(dev, res); 106 root = pci_find_parent_resource(dev, res);
107 107
108 err = -EINVAL; 108 err = -EINVAL;
109 if (root != NULL) 109 if (root != NULL)