[PATCH 1/2] resources: set type of new resource returned by__request_region()

From: Bjorn Helgaas
Date: Fri May 18 2012 - 19:18:33 EST


Previously we returned a new struct resource with only IORESOURCE_BUSY
set (and possibly IORESOURCE_MUXED or IORESOURCE_EXCLUSIVE), but no
MEM/IO/etc. bits set. The new resource should inherit the type of
its parent.

Signed-off-by: Bjorn Helgaas <bhelgaas@xxxxxxxxxx>
---
kernel/resource.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/kernel/resource.c b/kernel/resource.c
index 7e8ea66..04bb527 100644
--- a/kernel/resource.c
+++ b/kernel/resource.c
@@ -847,7 +847,8 @@ struct resource * __request_region(struct resource *parent,
res->name = name;
res->start = start;
res->end = start + n - 1;
- res->flags = IORESOURCE_BUSY;
+ res->flags = parent->flags;
+ res->flags |= IORESOURCE_BUSY;
res->flags |= flags;

write_lock(&resource_lock);

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/