Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

of: move of_address_to_resource and of_iomap declarations from sparc

Move of_address_to_resource and of_iomap declarations to common code. These
only differ on sparc, but the declarations are the same and don't need to
be in arch header.

Signed-off-by: Rob Herring <rob.herring@calxeda.com>
Acked-by: Grant Likely <grant.likely@linaro.org>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: sparclinux@vger.kernel.org

+17 -21
-8
arch/sparc/include/asm/prom.h
··· 59 59 extern void irq_trans_init(struct device_node *dp); 60 60 extern char *build_path_component(struct device_node *dp); 61 61 62 - /* SPARC has local implementations */ 63 - extern int of_address_to_resource(struct device_node *dev, int index, 64 - struct resource *r); 65 - #define of_address_to_resource of_address_to_resource 66 - 67 - void __iomem *of_iomap(struct device_node *node, int index); 68 - #define of_iomap of_iomap 69 - 70 62 #endif /* __KERNEL__ */ 71 63 #endif /* _SPARC_PROM_H */
+17 -13
include/linux/of_address.h
··· 60 60 struct of_pci_range_parser *parser, 61 61 struct of_pci_range *range); 62 62 #else /* CONFIG_OF_ADDRESS */ 63 - #ifndef of_address_to_resource 64 - static inline int of_address_to_resource(struct device_node *dev, int index, 65 - struct resource *r) 66 - { 67 - return -EINVAL; 68 - } 69 - #endif 70 63 static inline struct device_node *of_find_matching_node_by_address( 71 64 struct device_node *from, 72 65 const struct of_device_id *matches, ··· 67 74 { 68 75 return NULL; 69 76 } 70 - #ifndef of_iomap 71 - static inline void __iomem *of_iomap(struct device_node *device, int index) 72 - { 73 - return NULL; 74 - } 75 - #endif 77 + 76 78 static inline const __be32 *of_get_address(struct device_node *dev, int index, 77 79 u64 *size, unsigned int *flags) 78 80 { ··· 88 100 } 89 101 #endif /* CONFIG_OF_ADDRESS */ 90 102 103 + #ifdef CONFIG_OF 104 + extern int of_address_to_resource(struct device_node *dev, int index, 105 + struct resource *r); 106 + void __iomem *of_iomap(struct device_node *node, int index); 107 + #else 108 + static inline int of_address_to_resource(struct device_node *dev, int index, 109 + struct resource *r) 110 + { 111 + return -EINVAL; 112 + } 113 + 114 + static inline void __iomem *of_iomap(struct device_node *device, int index) 115 + { 116 + return NULL; 117 + } 118 + #endif 91 119 92 120 #if defined(CONFIG_OF_ADDRESS) && defined(CONFIG_PCI) 93 121 extern const __be32 *of_get_pci_address(struct device_node *dev, int bar_no,