Skip to content

Commit

Permalink
Fix pci_claim_resource
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Matthew Wilcox authored and Linus Torvalds committed Jun 17, 2009
1 parent 7cc4766 commit cebd78a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/pci/setup-res.c
Original file line number Diff line number Diff line change
Expand Up @@ -99,11 +99,11 @@ void pci_update_resource(struct pci_dev *dev, int resno)
int pci_claim_resource(struct pci_dev *dev, int resource)
{
struct resource *res = &dev->resource[resource];
struct resource *root = NULL;
struct resource *root;
char *dtype = resource < PCI_BRIDGE_RESOURCES ? "device" : "bridge";
int err;

root = pcibios_select_root(dev, res);
root = pci_find_parent_resource(dev, res);

err = -EINVAL;
if (root != NULL)
Expand Down

0 comments on commit cebd78a

Please sign in to comment.