diff options
author | David S. Miller <davem@sunset.davemloft.net> | 2006-12-29 00:01:32 -0500 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2006-12-31 17:06:05 -0500 |
commit | e3a411a3dfc1d633504aa63efab32b7e00318454 (patch) | |
tree | 2ba6117448edd7056c8fa48cc6a696ae73a6c21a /arch/sparc64 | |
parent | 6fc5bae797a6632bbccdd49a1b6a96121368a4b9 (diff) |
[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/sparc64')
-rw-r--r-- | arch/sparc64/kernel/of_device.c | 7 |
1 files changed, 5 insertions, 2 deletions
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 | |||
144 | } | 144 | } |
145 | EXPORT_SYMBOL(of_ioremap); | 145 | EXPORT_SYMBOL(of_ioremap); |
146 | 146 | ||
147 | void of_iounmap(void __iomem *base, unsigned long size) | 147 | void of_iounmap(struct resource *res, void __iomem *base, unsigned long size) |
148 | { | 148 | { |
149 | release_region((unsigned long) base, size); | 149 | if (res->flags & IORESOURCE_MEM) |
150 | release_mem_region((unsigned long) base, size); | ||
151 | else | ||
152 | release_region((unsigned long) base, size); | ||
150 | } | 153 | } |
151 | EXPORT_SYMBOL(of_iounmap); | 154 | EXPORT_SYMBOL(of_iounmap); |
152 | 155 | ||