Module: xenomai-2.5
Branch: master
Commit: 50b289784ef2b0734bef1e99b008ff4b79ad5409
URL:    
http://git.xenomai.org/?p=xenomai-2.5.git;a=commit;h=50b289784ef2b0734bef1e99b008ff4b79ad5409

Author: Philippe Gerum <r...@xenomai.org>
Date:   Wed Oct  6 08:00:47 2010 +0200

can: adapt to platform driver infrastructure changes for 2.6.35

---

 ksrc/drivers/can/mscan/rtcan_mscan_mpc5xxx.c |   16 ++++++++++++++--
 ksrc/drivers/can/mscan/rtcan_mscan_regs.h    |    6 ++++++
 2 files changed, 20 insertions(+), 2 deletions(-)

diff --git a/ksrc/drivers/can/mscan/rtcan_mscan_mpc5xxx.c 
b/ksrc/drivers/can/mscan/rtcan_mscan_mpc5xxx.c
index 48abd89..52f3ec8 100644
--- a/ksrc/drivers/can/mscan/rtcan_mscan_mpc5xxx.c
+++ b/ksrc/drivers/can/mscan/rtcan_mscan_mpc5xxx.c
@@ -76,7 +76,7 @@ static u32 __devinit mpc52xx_can_get_clock(struct of_device 
*ofdev,
        else
                *mscan_clksrc = MSCAN_CLKSRC_XTAL;
 
-       freq = mpc5xxx_get_bus_frequency(ofdev->node);
+       freq = mpc5xxx_get_bus_frequency(mpc5xxx_get_of_node(ofdev));
        if (!freq)
                return 0;
 
@@ -254,7 +254,7 @@ static int __devinit mpc5xxx_can_probe(struct of_device 
*ofdev,
                                       const struct of_device_id *id)
 {
        struct mpc5xxx_can_data *data = (struct mpc5xxx_can_data *)id->data;
-       struct device_node *np = ofdev->node;
+       struct device_node *np = mpc5xxx_get_of_node(ofdev);
        struct rtcan_device *dev;
        void __iomem *base;
        const char *clock_name = NULL;
@@ -349,6 +349,17 @@ static struct of_device_id __devinitdata 
mpc5xxx_can_table[] = {
        {},
 };
 
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)
+static struct of_platform_driver mpc5xxx_can_driver = {
+       .driver = {
+               .owner = THIS_MODULE,
+               .name = RTCAN_DRV_NAME,
+               .of_match_table = mpc5xxx_can_table,
+       },
+       .probe = mpc5xxx_can_probe,
+       .remove = __devexit_p(mpc5xxx_can_remove),
+};
+#else
 static struct of_platform_driver mpc5xxx_can_driver = {
        .owner = THIS_MODULE,
        .name = RTCAN_DRV_NAME,
@@ -356,6 +367,7 @@ static struct of_platform_driver mpc5xxx_can_driver = {
        .remove = __devexit_p(mpc5xxx_can_remove),
        .match_table = mpc5xxx_can_table,
 };
+#endif
 
 static int __init mpc5xxx_can_init(void)
 {
diff --git a/ksrc/drivers/can/mscan/rtcan_mscan_regs.h 
b/ksrc/drivers/can/mscan/rtcan_mscan_regs.h
index dfad5e0..1df50a5 100644
--- a/ksrc/drivers/can/mscan/rtcan_mscan_regs.h
+++ b/ksrc/drivers/can/mscan/rtcan_mscan_regs.h
@@ -63,6 +63,12 @@ static inline void __iomem *mpc5xxx_gpio_find_and_map(void)
 #endif
 #endif
 
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)
+#define mpc5xxx_get_of_node(ofdev) (ofdev)->dev.of_node
+#else
+#define mpc5xxx_get_of_node(ofdev) (ofdev)->node
+#endif
+
 #define MSCAN_CAN1_ADDR        (MSCAN_MBAR + 0x0900) /* MSCAN Module 1 */
 #define MSCAN_CAN2_ADDR        (MSCAN_MBAR + 0x0980) /* MSCAN Module 2 */
 #define MSCAN_SIZE     0x80


_______________________________________________
Xenomai-git mailing list
Xenomai-git@gna.org
https://mail.gna.org/listinfo/xenomai-git

Reply via email to