[SPARC]: Add of_io{remap,unmap}().

Signed-off-by: David S. Miller <davem@davemloft.net>

authored by David S. Miller and committed by David S. Miller 3ca9fab4 95714e12

+40
+17
arch/sparc/kernel/ioport.c
··· 26 26 */ 27 27 28 28 #include <linux/config.h> 29 + #include <linux/module.h> 29 30 #include <linux/sched.h> 30 31 #include <linux/kernel.h> 31 32 #include <linux/errno.h> ··· 41 40 #include <asm/vaddrs.h> 42 41 #include <asm/oplib.h> 43 42 #include <asm/prom.h> 43 + #include <asm/of_device.h> 44 44 #include <asm/sbus.h> 45 45 #include <asm/page.h> 46 46 #include <asm/pgalloc.h> ··· 144 142 return _sparc_alloc_io(phyres->flags & 0xF, 145 143 phyres->start + offset, size, name); 146 144 } 145 + 146 + void __iomem *of_ioremap(struct resource *res, unsigned long offset, 147 + unsigned long size, char *name) 148 + { 149 + return _sparc_alloc_io(res->flags & 0xF, 150 + res->start + offset, 151 + size, name); 152 + } 153 + EXPORT_SYMBOL(of_ioremap); 154 + 155 + void of_iounmap(void __iomem *base, unsigned long size) 156 + { 157 + iounmap(base); 158 + } 159 + EXPORT_SYMBOL(of_iounmap); 147 160 148 161 /* 149 162 */
+17
arch/sparc64/kernel/of_device.c
··· 129 129 return error; 130 130 } 131 131 132 + void __iomem *of_ioremap(struct resource *res, unsigned long offset, unsigned long size, char *name) 133 + { 134 + unsigned long ret = res->start + offset; 135 + 136 + if (!request_region(ret, size, name)) 137 + ret = 0; 138 + 139 + return (void __iomem *) ret; 140 + } 141 + EXPORT_SYMBOL(of_ioremap); 142 + 143 + void of_iounmap(void __iomem *base, unsigned long size) 144 + { 145 + release_region((unsigned long) base, size); 146 + } 147 + EXPORT_SYMBOL(of_iounmap); 148 + 132 149 #ifdef CONFIG_PCI 133 150 struct bus_type isa_bus_type = { 134 151 .name = "isa",
+3
include/asm-sparc/of_device.h
··· 31 31 }; 32 32 #define to_of_device(d) container_of(d, struct of_device, dev) 33 33 34 + extern void __iomem *of_ioremap(struct resource *res, unsigned long offset, unsigned long size, char *name); 35 + extern void of_iounmap(void __iomem *base, unsigned long size); 36 + 34 37 extern const struct of_device_id *of_match_device( 35 38 const struct of_device_id *matches, const struct of_device *dev); 36 39
+3
include/asm-sparc64/of_device.h
··· 32 32 }; 33 33 #define to_of_device(d) container_of(d, struct of_device, dev) 34 34 35 + extern void __iomem *of_ioremap(struct resource *res, unsigned long offset, unsigned long size, char *name); 36 + extern void of_iounmap(void __iomem *base, unsigned long size); 37 + 35 38 extern const struct of_device_id *of_match_device( 36 39 const struct of_device_id *matches, const struct of_device *dev); 37 40