Explorar o código

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>
Anton Vorontsov %!s(int64=16) %!d(string=hai) anos
pai
achega
3f3b163202
Modificáronse 2 ficheiros con 24 adicións e 0 borrados
  1. 12 0
      arch/powerpc/include/asm/device.h
  2. 12 0
      arch/sparc/include/asm/device.h

+ 12 - 0
arch/powerpc/include/asm/device.h

@@ -18,4 +18,16 @@ struct dev_archdata {
 	void			*dma_data;
 	void			*dma_data;
 };
 };
 
 
+static inline void dev_archdata_set_node(struct dev_archdata *ad,
+					 struct device_node *np)
+{
+	ad->of_node = np;
+}
+
+static inline struct device_node *
+dev_archdata_get_node(const struct dev_archdata *ad)
+{
+	return ad->of_node;
+}
+
 #endif /* _ASM_POWERPC_DEVICE_H */
 #endif /* _ASM_POWERPC_DEVICE_H */

+ 12 - 0
arch/sparc/include/asm/device.h

@@ -20,4 +20,16 @@ struct dev_archdata {
 	int			numa_node;
 	int			numa_node;
 };
 };
 
 
+static inline void dev_archdata_set_node(struct dev_archdata *ad,
+					 struct device_node *np)
+{
+	ad->prom_node = np;
+}
+
+static inline struct device_node *
+dev_archdata_get_node(const struct dev_archdata *ad)
+{
+	return ad->prom_node;
+}
+
 #endif /* _ASM_SPARC_DEVICE_H */
 #endif /* _ASM_SPARC_DEVICE_H */