[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 */ 27 28 #include <linux/config.h> 29 #include <linux/sched.h> 30 #include <linux/kernel.h> 31 #include <linux/errno.h> ··· 41 #include <asm/vaddrs.h> 42 #include <asm/oplib.h> 43 #include <asm/prom.h> 44 #include <asm/sbus.h> 45 #include <asm/page.h> 46 #include <asm/pgalloc.h> ··· 144 return _sparc_alloc_io(phyres->flags & 0xF, 145 phyres->start + offset, size, name); 146 } 147 148 /* 149 */
··· 26 */ 27 28 #include <linux/config.h> 29 + #include <linux/module.h> 30 #include <linux/sched.h> 31 #include <linux/kernel.h> 32 #include <linux/errno.h> ··· 40 #include <asm/vaddrs.h> 41 #include <asm/oplib.h> 42 #include <asm/prom.h> 43 + #include <asm/of_device.h> 44 #include <asm/sbus.h> 45 #include <asm/page.h> 46 #include <asm/pgalloc.h> ··· 142 return _sparc_alloc_io(phyres->flags & 0xF, 143 phyres->start + offset, size, name); 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); 160 161 /* 162 */
+17
arch/sparc64/kernel/of_device.c
··· 129 return error; 130 } 131 132 #ifdef CONFIG_PCI 133 struct bus_type isa_bus_type = { 134 .name = "isa",
··· 129 return error; 130 } 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 + 149 #ifdef CONFIG_PCI 150 struct bus_type isa_bus_type = { 151 .name = "isa",
+3
include/asm-sparc/of_device.h
··· 31 }; 32 #define to_of_device(d) container_of(d, struct of_device, dev) 33 34 extern const struct of_device_id *of_match_device( 35 const struct of_device_id *matches, const struct of_device *dev); 36
··· 31 }; 32 #define to_of_device(d) container_of(d, struct of_device, dev) 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 + 37 extern const struct of_device_id *of_match_device( 38 const struct of_device_id *matches, const struct of_device *dev); 39
+3
include/asm-sparc64/of_device.h
··· 32 }; 33 #define to_of_device(d) container_of(d, struct of_device, dev) 34 35 extern const struct of_device_id *of_match_device( 36 const struct of_device_id *matches, const struct of_device *dev); 37
··· 32 }; 33 #define to_of_device(d) container_of(d, struct of_device, dev) 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 + 38 extern const struct of_device_id *of_match_device( 39 const struct of_device_id *matches, const struct of_device *dev); 40