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

powerpc and sparc: Introduce dev_archdata node accessors

The name of the device_node field differ across the platforms, so we
have to implement inlined accessors. This is needed to avoid ugly
#ifdef in the generic code.

Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
Acked-by: David S. Miller <davem@davemloft.net>
Acked-by: Grant Likely <grant.likely@secretlab.ca>
Signed-off-by: Paul Mackerras <paulus@samba.org>

authored by

Anton Vorontsov and committed by
Paul Mackerras
3f3b1632 a0e2f9f4

+24
+12
arch/powerpc/include/asm/device.h
··· 18 18 void *dma_data; 19 19 }; 20 20 21 + static inline void dev_archdata_set_node(struct dev_archdata *ad, 22 + struct device_node *np) 23 + { 24 + ad->of_node = np; 25 + } 26 + 27 + static inline struct device_node * 28 + dev_archdata_get_node(const struct dev_archdata *ad) 29 + { 30 + return ad->of_node; 31 + } 32 + 21 33 #endif /* _ASM_POWERPC_DEVICE_H */
+12
arch/sparc/include/asm/device.h
··· 20 20 int numa_node; 21 21 }; 22 22 23 + static inline void dev_archdata_set_node(struct dev_archdata *ad, 24 + struct device_node *np) 25 + { 26 + ad->prom_node = np; 27 + } 28 + 29 + static inline struct device_node * 30 + dev_archdata_get_node(const struct dev_archdata *ad) 31 + { 32 + return ad->prom_node; 33 + } 34 + 23 35 #endif /* _ASM_SPARC_DEVICE_H */