* [Xenomai-core] Build issue with rtcan and I-pipe for linux 2.6.36 on powerpc.
@ 2011-01-02 19:53 Gilles Chanteperdrix
2011-01-03 10:32 ` Wolfgang Grandegger
0 siblings, 1 reply; 7+ messages in thread
From: Gilles Chanteperdrix @ 2011-01-02 19:53 UTC (permalink / raw)
To: Wolfgang Grandegger; +Cc: Xenomai core
Hi Wolfgang,
It seems we have an issue building rtcan for mpc5xxx with Linux 2.6.36.
As far as I understood the of_device structure disappeared and the
"device tree" bits were integrated in the device structure, which causes
several errors when building ksrc/drivers/can/mscan/rtcan_mscan_mpc5xxx.c
Build log details here:
http://sisyphus.hd.free.fr/~gilles/bx/lite5200/2.6.36-ppc_6xx-gcc-4.2.2/log.html#1
Regards.
--
Gilles.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Xenomai-core] Build issue with rtcan and I-pipe for linux 2.6.36 on powerpc.
2011-01-02 19:53 [Xenomai-core] Build issue with rtcan and I-pipe for linux 2.6.36 on powerpc Gilles Chanteperdrix
@ 2011-01-03 10:32 ` Wolfgang Grandegger
2011-01-03 21:11 ` Gilles Chanteperdrix
2011-01-05 20:22 ` Jan Kiszka
0 siblings, 2 replies; 7+ messages in thread
From: Wolfgang Grandegger @ 2011-01-03 10:32 UTC (permalink / raw)
To: Gilles Chanteperdrix; +Cc: Xenomai core, Wolfgang Grandegger
[-- Attachment #1: Type: text/plain, Size: 541 bytes --]
Hi Gilles,
the attached patch fixes the issue.
On 01/02/2011 08:53 PM, Gilles Chanteperdrix wrote:
>
> Hi Wolfgang,
>
> It seems we have an issue building rtcan for mpc5xxx with Linux 2.6.36.
> As far as I understood the of_device structure disappeared and the
> "device tree" bits were integrated in the device structure, which causes
> several errors when building ksrc/drivers/can/mscan/rtcan_mscan_mpc5xxx.c
>
> Build log details here:
> http://sisyphus.hd.free.fr/~gilles/bx/lite5200/2.6.36-ppc_6xx-gcc-4.2.2/log.html#1
Wolfgang.
[-- Attachment #2: 0001-wrappers-fixup-struct-of_device-for-RTCAN-MPC5xxx-dr.patch --]
[-- Type: text/x-diff, Size: 921 bytes --]
>From 94e2e92946a74bed44b9be208a3cef43e3e52477 Mon Sep 17 00:00:00 2001
From: Wolfgang Grandegger <wg@domain.hid>
Date: Mon, 3 Jan 2011 10:59:09 +0100
Subject: [PATCH] wrappers: fixup "struct of_device" for RTCAN MPC5xxx driver
Since 2.6.36, of_device is just an alias for platform_device.
Signed-off-by: Wolfgang Grandegger <wg@domain.hid>
---
include/asm-powerpc/wrappers.h | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/include/asm-powerpc/wrappers.h b/include/asm-powerpc/wrappers.h
index 7f1214a..fb49307 100644
--- a/include/asm-powerpc/wrappers.h
+++ b/include/asm-powerpc/wrappers.h
@@ -191,4 +191,8 @@ typedef irq_handler_t rthal_irq_host_handler_t;
#define mpc5xxx_get_bus_frequency(node) mpc52xx_find_ipb_freq(node)
#endif
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36)
+#define of_device platform_device
+#endif
+
#endif /* _XENO_ASM_POWERPC_WRAPPERS_H */
--
1.7.2.3
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [Xenomai-core] Build issue with rtcan and I-pipe for linux 2.6.36 on powerpc.
2011-01-03 10:32 ` Wolfgang Grandegger
@ 2011-01-03 21:11 ` Gilles Chanteperdrix
2011-01-05 20:22 ` Jan Kiszka
1 sibling, 0 replies; 7+ messages in thread
From: Gilles Chanteperdrix @ 2011-01-03 21:11 UTC (permalink / raw)
To: Wolfgang Grandegger; +Cc: Xenomai core, Wolfgang Grandegger
Wolfgang Grandegger wrote:
> Hi Gilles,
>
> the attached patch fixes the issue.
Applied, thanks.
--
Gilles.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Xenomai-core] Build issue with rtcan and I-pipe for linux 2.6.36 on powerpc.
2011-01-03 10:32 ` Wolfgang Grandegger
2011-01-03 21:11 ` Gilles Chanteperdrix
@ 2011-01-05 20:22 ` Jan Kiszka
2011-01-05 20:25 ` Gilles Chanteperdrix
1 sibling, 1 reply; 7+ messages in thread
From: Jan Kiszka @ 2011-01-05 20:22 UTC (permalink / raw)
To: Wolfgang Grandegger; +Cc: Xenomai core, Wolfgang Grandegger
[-- Attachment #1: Type: text/plain, Size: 338 bytes --]
Am 03.01.2011 11:32, Wolfgang Grandegger wrote:
> Hi Gilles,
>
> the attached patch fixes the issue.
>
Nothing critical, but I think we should consistently wrap the other way
around
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,36)
#define platform_device of_device
#endif
and update the users to the new style.
Jan
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 259 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Xenomai-core] Build issue with rtcan and I-pipe for linux 2.6.36 on powerpc.
2011-01-05 20:22 ` Jan Kiszka
@ 2011-01-05 20:25 ` Gilles Chanteperdrix
2011-01-05 20:30 ` Jan Kiszka
0 siblings, 1 reply; 7+ messages in thread
From: Gilles Chanteperdrix @ 2011-01-05 20:25 UTC (permalink / raw)
To: Jan Kiszka; +Cc: Wolfgang Grandegger, Xenomai core
Jan Kiszka wrote:
> Am 03.01.2011 11:32, Wolfgang Grandegger wrote:
>> Hi Gilles,
>>
>> the attached patch fixes the issue.
>>
>
> Nothing critical, but I think we should consistently wrap the other way
> around
>
> #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,36)
> #define platform_device of_device
> #endif
>
> and update the users to the new style.
Err... Am I missing the obvious here? If you include
<linux/platform_device.h> on powerpc you then get a massive mess prior
to 2.6.36.
--
Gilles.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Xenomai-core] Build issue with rtcan and I-pipe for linux 2.6.36 on powerpc.
2011-01-05 20:25 ` Gilles Chanteperdrix
@ 2011-01-05 20:30 ` Jan Kiszka
2011-01-05 20:39 ` Gilles Chanteperdrix
0 siblings, 1 reply; 7+ messages in thread
From: Jan Kiszka @ 2011-01-05 20:30 UTC (permalink / raw)
To: Gilles Chanteperdrix; +Cc: Wolfgang Grandegger, Xenomai core
[-- Attachment #1: Type: text/plain, Size: 815 bytes --]
Am 05.01.2011 21:25, Gilles Chanteperdrix wrote:
> Jan Kiszka wrote:
>> Am 03.01.2011 11:32, Wolfgang Grandegger wrote:
>>> Hi Gilles,
>>>
>>> the attached patch fixes the issue.
>>>
>>
>> Nothing critical, but I think we should consistently wrap the other way
>> around
>>
>> #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,36)
>> #define platform_device of_device
>> #endif
>>
>> and update the users to the new style.
>
> Err... Am I missing the obvious here? If you include
> <linux/platform_device.h> on powerpc you then get a massive mess prior
> to 2.6.36.
Maybe this is an exception, don't know the powerpc details, but
generally our drivers should be written according to latest (supported)
kernel APIs and then extended/wrapped/etc. to compile with older
versions as well.
Jan
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 259 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Xenomai-core] Build issue with rtcan and I-pipe for linux 2.6.36 on powerpc.
2011-01-05 20:30 ` Jan Kiszka
@ 2011-01-05 20:39 ` Gilles Chanteperdrix
0 siblings, 0 replies; 7+ messages in thread
From: Gilles Chanteperdrix @ 2011-01-05 20:39 UTC (permalink / raw)
To: Jan Kiszka; +Cc: Wolfgang Grandegger, Xenomai core
Jan Kiszka wrote:
> Am 05.01.2011 21:25, Gilles Chanteperdrix wrote:
>> Jan Kiszka wrote:
>>> Am 03.01.2011 11:32, Wolfgang Grandegger wrote:
>>>> Hi Gilles,
>>>>
>>>> the attached patch fixes the issue.
>>>>
>>> Nothing critical, but I think we should consistently wrap the other way
>>> around
>>>
>>> #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,36)
>>> #define platform_device of_device
>>> #endif
>>>
>>> and update the users to the new style.
>> Err... Am I missing the obvious here? If you include
>> <linux/platform_device.h> on powerpc you then get a massive mess prior
>> to 2.6.36.
>
> Maybe this is an exception, don't know the powerpc details, but
> generally our drivers should be written according to latest (supported)
> kernel APIs and then extended/wrapped/etc. to compile with older
> versions as well.
platform_device has existed for a long time in the 2.6 series: the
matching between platform_device and platform_driver is the hack which
replaces enumeration USB and PCI bus provide on embedded systems busses.
Some platforms introduced of_device to handle another kind of
enumeration: the device tree.
Now, it seems the member which were specific to of_device migrated to
the platform_device structure, so, the of_device structure was cancelled
completely, and replaced by platform_device all over the place.
At least, is it my understanding.
Now, we can typedef device_tree_device to be of_device on old kernels,
and platform_device on new kernels, but using of_device for this does
not seem stupid either.
--
Gilles.
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2011-01-05 20:39 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-01-02 19:53 [Xenomai-core] Build issue with rtcan and I-pipe for linux 2.6.36 on powerpc Gilles Chanteperdrix
2011-01-03 10:32 ` Wolfgang Grandegger
2011-01-03 21:11 ` Gilles Chanteperdrix
2011-01-05 20:22 ` Jan Kiszka
2011-01-05 20:25 ` Gilles Chanteperdrix
2011-01-05 20:30 ` Jan Kiszka
2011-01-05 20:39 ` Gilles Chanteperdrix
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.