* [PATCH 1/2] powerpc and sparc: Introduce dev_archdata node accessors
@ 2008-11-28 19:13 Anton Vorontsov
2008-11-30 22:23 ` Michael Ellerman
0 siblings, 1 reply; 2+ messages in thread
From: Anton Vorontsov @ 2008-11-28 19:13 UTC (permalink / raw)
To: Paul Mackerras; +Cc: David Miller, linuxppc-dev
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>
---
arch/powerpc/include/asm/device.h | 12 ++++++++++++
arch/sparc/include/asm/device.h | 12 ++++++++++++
2 files changed, 24 insertions(+), 0 deletions(-)
diff --git a/arch/powerpc/include/asm/device.h b/arch/powerpc/include/asm/device.h
index dfd504c..7d2277c 100644
--- a/arch/powerpc/include/asm/device.h
+++ b/arch/powerpc/include/asm/device.h
@@ -18,4 +18,16 @@ struct dev_archdata {
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 */
diff --git a/arch/sparc/include/asm/device.h b/arch/sparc/include/asm/device.h
index 19790eb..3702e08 100644
--- a/arch/sparc/include/asm/device.h
+++ b/arch/sparc/include/asm/device.h
@@ -20,4 +20,16 @@ struct dev_archdata {
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 */
--
1.5.6.5
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH 1/2] powerpc and sparc: Introduce dev_archdata node accessors
2008-11-28 19:13 [PATCH 1/2] powerpc and sparc: Introduce dev_archdata node accessors Anton Vorontsov
@ 2008-11-30 22:23 ` Michael Ellerman
0 siblings, 0 replies; 2+ messages in thread
From: Michael Ellerman @ 2008-11-30 22:23 UTC (permalink / raw)
To: Anton Vorontsov; +Cc: linuxppc-dev, Paul Mackerras, David Miller
[-- Attachment #1: Type: text/plain, Size: 928 bytes --]
On Fri, 2008-11-28 at 22:13 +0300, Anton Vorontsov wrote:
> 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.
My grep skills may not be 1337 enough, but I only see maybe three uses
of arch_data.prom_node in arch/sparc:
# git grep "\.prom_node" arch/sparc/
arch/sparc/include/asm/fb.h: node = dev->archdata.prom_node;
arch/sparc/kernel/smp.c: cpu_data(id).prom_node = cpu_node;
arch/sparc/kernel/of_device.c: sd->prom_node = dp;
And about 15 in arch/powerpc.
Would it be simpler to have sparc use "of_node"? DaveM?
cheers
--
Michael Ellerman
OzLabs, IBM Australia Development Lab
wwweb: http://michael.ellerman.id.au
phone: +61 2 6212 1183 (tie line 70 21183)
We do not inherit the earth from our ancestors,
we borrow it from our children. - S.M.A.R.T Person
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 197 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-11-30 22:23 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-11-28 19:13 [PATCH 1/2] powerpc and sparc: Introduce dev_archdata node accessors Anton Vorontsov
2008-11-30 22:23 ` Michael Ellerman
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).