diff options
author | Paul Mundt <lethal@linux-sh.org> | 2010-01-18 07:30:29 -0500 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2010-01-18 07:30:29 -0500 |
commit | 4f744affc345f8b158615e0cdd01d1f4985837c3 (patch) | |
tree | eab721c5f19274e986fce7be609890159ffe63b9 /arch/sh | |
parent | 0b59e38ffaf7b201ff6afe5b736365d16848c7e3 (diff) |
sh: Make iounmap_fixed() return success/failure for iounmap() path.
This converts iounmap_fixed() to return success/error if it handled the
unmap request or not. At the same time, drop the __init label, as this
can be called in to later.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh')
-rw-r--r-- | arch/sh/include/asm/io.h | 5 | ||||
-rw-r--r-- | arch/sh/mm/ioremap_fixed.c | 9 |
2 files changed, 10 insertions, 4 deletions
diff --git a/arch/sh/include/asm/io.h b/arch/sh/include/asm/io.h index 9aa9438c66c3..6a0dd8c1e0a9 100644 --- a/arch/sh/include/asm/io.h +++ b/arch/sh/include/asm/io.h | |||
@@ -22,6 +22,7 @@ | |||
22 | * for old compat code for I/O offseting to SuperIOs, all of which are | 22 | * for old compat code for I/O offseting to SuperIOs, all of which are |
23 | * better handled through the machvec ioport mapping routines these days. | 23 | * better handled through the machvec ioport mapping routines these days. |
24 | */ | 24 | */ |
25 | #include <linux/errno.h> | ||
25 | #include <asm/cache.h> | 26 | #include <asm/cache.h> |
26 | #include <asm/system.h> | 27 | #include <asm/system.h> |
27 | #include <asm/addrspace.h> | 28 | #include <asm/addrspace.h> |
@@ -239,7 +240,7 @@ void __iounmap(void __iomem *addr); | |||
239 | 240 | ||
240 | #ifdef CONFIG_IOREMAP_FIXED | 241 | #ifdef CONFIG_IOREMAP_FIXED |
241 | extern void __iomem *ioremap_fixed(resource_size_t, unsigned long, pgprot_t); | 242 | extern void __iomem *ioremap_fixed(resource_size_t, unsigned long, pgprot_t); |
242 | extern void iounmap_fixed(void __iomem *); | 243 | extern int iounmap_fixed(void __iomem *); |
243 | extern void ioremap_fixed_init(void); | 244 | extern void ioremap_fixed_init(void); |
244 | #else | 245 | #else |
245 | static inline void __iomem * | 246 | static inline void __iomem * |
@@ -249,7 +250,7 @@ ioremap_fixed(resource_size t phys_addr, unsigned long size, pgprot_t prot) | |||
249 | } | 250 | } |
250 | 251 | ||
251 | static inline void ioremap_fixed_init(void) { } | 252 | static inline void ioremap_fixed_init(void) { } |
252 | static inline void iounmap_fixed(void __iomem *addr) { } | 253 | static inline int iounmap_fixed(void __iomem *addr) { return -EINVAL; } |
253 | #endif | 254 | #endif |
254 | 255 | ||
255 | static inline void __iomem * | 256 | static inline void __iomem * |
diff --git a/arch/sh/mm/ioremap_fixed.c b/arch/sh/mm/ioremap_fixed.c index 3a9d3d88fe8d..425f6c6bf250 100644 --- a/arch/sh/mm/ioremap_fixed.c +++ b/arch/sh/mm/ioremap_fixed.c | |||
@@ -103,7 +103,7 @@ ioremap_fixed(resource_size_t phys_addr, unsigned long size, pgprot_t prot) | |||
103 | return map->addr; | 103 | return map->addr; |
104 | } | 104 | } |
105 | 105 | ||
106 | void __init iounmap_fixed(void __iomem *addr) | 106 | int iounmap_fixed(void __iomem *addr) |
107 | { | 107 | { |
108 | enum fixed_addresses idx; | 108 | enum fixed_addresses idx; |
109 | unsigned long virt_addr; | 109 | unsigned long virt_addr; |
@@ -122,8 +122,11 @@ void __init iounmap_fixed(void __iomem *addr) | |||
122 | } | 122 | } |
123 | } | 123 | } |
124 | 124 | ||
125 | /* | ||
126 | * If we don't match, it's not for us. | ||
127 | */ | ||
125 | if (slot < 0) | 128 | if (slot < 0) |
126 | return; | 129 | return -EINVAL; |
127 | 130 | ||
128 | virt_addr = (unsigned long)addr; | 131 | virt_addr = (unsigned long)addr; |
129 | 132 | ||
@@ -141,4 +144,6 @@ void __init iounmap_fixed(void __iomem *addr) | |||
141 | 144 | ||
142 | map->size = 0; | 145 | map->size = 0; |
143 | map->addr = NULL; | 146 | map->addr = NULL; |
147 | |||
148 | return 0; | ||
144 | } | 149 | } |