diff options
author | 2009-10-15 08:44:42 +0200 | |
---|---|---|
committer | 2009-10-15 08:44:44 +0200 | |
commit | b226f744d40b052ac126c4cb16c76f66e5185128 (patch) | |
tree | e86f5c059dde241472689cbe2d55429cd15b2d56 /drivers/pci/setup-bus.c | |
parent | perf tools: Move threads & last_match to threads.c (diff) | |
parent | Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394-2.6 (diff) | |
download | linux-dev-b226f744d40b052ac126c4cb16c76f66e5185128.tar.xz linux-dev-b226f744d40b052ac126c4cb16c76f66e5185128.zip |
Merge branch 'linus' into perf/core
Merge reason: pick up tools/perf/ changes from upstream.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'drivers/pci/setup-bus.c')
-rw-r--r-- | drivers/pci/setup-bus.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/drivers/pci/setup-bus.c b/drivers/pci/setup-bus.c index cb1a027eb552..0959430534b2 100644 --- a/drivers/pci/setup-bus.c +++ b/drivers/pci/setup-bus.c @@ -299,8 +299,17 @@ static struct resource *find_free_bus_resource(struct pci_bus *bus, unsigned lon r = bus->resource[i]; if (r == &ioport_resource || r == &iomem_resource) continue; - if (r && (r->flags & type_mask) == type && !r->parent) - return r; + if (r && (r->flags & type_mask) == type) { + if (!r->parent) + return r; + /* + * if there is no child under that, we should release + * and use it. don't need to reset it, pbus_size_* will + * set it again + */ + if (!r->child && !release_resource(r)) + return r; + } } return NULL; } |