summaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorDavid S. Miller2006-12-29 06:01:32 +0100
committerDavid S. Miller2006-12-31 23:06:05 +0100
commite3a411a3dfc1d633504aa63efab32b7e00318454 (patch)
tree2ba6117448edd7056c8fa48cc6a696ae73a6c21a /arch
parent[SPARC64]: Fix "mem=xxx" handling. (diff)
downloadkernel-qcow2-linux-e3a411a3dfc1d633504aa63efab32b7e00318454.tar.gz
kernel-qcow2-linux-e3a411a3dfc1d633504aa63efab32b7e00318454.tar.xz
kernel-qcow2-linux-e3a411a3dfc1d633504aa63efab32b7e00318454.zip
[SPARC64]: Fix of_iounmap() region release.
We need to pass in the resource otherwise we cannot release the region properly. We must know whether it is an I/O or MEM resource. Spotted by Eric Brower. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch')
-rw-r--r--arch/sparc/kernel/ioport.c2
-rw-r--r--arch/sparc64/kernel/of_device.c7
2 files changed, 6 insertions, 3 deletions
diff --git a/arch/sparc/kernel/ioport.c b/arch/sparc/kernel/ioport.c
index 00a39760877b..987ec6782f99 100644
--- a/arch/sparc/kernel/ioport.c
+++ b/arch/sparc/kernel/ioport.c
@@ -153,7 +153,7 @@ void __iomem *of_ioremap(struct resource *res, unsigned long offset,
}
EXPORT_SYMBOL(of_ioremap);
-void of_iounmap(void __iomem *base, unsigned long size)
+void of_iounmap(struct resource *res, void __iomem *base, unsigned long size)
{
iounmap(base);
}
diff --git a/arch/sparc64/kernel/of_device.c b/arch/sparc64/kernel/of_device.c
index cec0eceae552..b0f3e0082a0d 100644
--- a/arch/sparc64/kernel/of_device.c
+++ b/arch/sparc64/kernel/of_device.c
@@ -144,9 +144,12 @@ void __iomem *of_ioremap(struct resource *res, unsigned long offset, unsigned lo
}
EXPORT_SYMBOL(of_ioremap);
-void of_iounmap(void __iomem *base, unsigned long size)
+void of_iounmap(struct resource *res, void __iomem *base, unsigned long size)
{
- release_region((unsigned long) base, size);
+ if (res->flags & IORESOURCE_MEM)
+ release_mem_region((unsigned long) base, size);
+ else
+ release_region((unsigned long) base, size);
}
EXPORT_SYMBOL(of_iounmap);