aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci/setup-bus.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2009-10-15 08:44:42 +0200
committerIngo Molnar <mingo@elte.hu>2009-10-15 08:44:44 +0200
commitb226f744d40b052ac126c4cb16c76f66e5185128 (patch)
treee86f5c059dde241472689cbe2d55429cd15b2d56 /drivers/pci/setup-bus.c
parentperf tools: Move threads & last_match to threads.c (diff)
parentMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394-2.6 (diff)
downloadlinux-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.c13
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;
}