Hi,

I'm currently porting the r8169 driver to 2.6.28 (which builds fine by
now, but not sure if it works properly yet). After a few hours of
debugging I found a problem in the Ethercat master code, which is due to
an API change in the 2.6.27 kernels.

The device_create() call has received another argument in >= 2.6.27.

This is the 2.6.26 version:
extern struct device *device_create(struct class *cls, struct device *parent,
                                    dev_t devt, const char *fmt, ...)
                                    __attribute__((format(printf, 4, 5)));

This is from >= 2.6.27:
extern struct device *device_create(struct class *cls, struct device *parent,
                                    dev_t devt, void *drvdata,
                                    const char *fmt, ...)
                                    __attribute__((format(printf, 5, 6)));

Attached is a patch which should fix the issue.

I'll post more patches and test results of r8169 on 2.6.28 later next
week or so.

HTH, Uwe.
-- 
http://www.hermann-uwe.de  | http://www.holsham-traders.de
http://www.crazy-hacks.org | http://www.unmaintained-free-software.org
diff -Naur ethercat-devel-r1667.orig/master/master.c ethercat-devel-r1667/master/master.c
--- ethercat-devel-r1667.orig/master/master.c	2009-02-24 13:51:39.000000000 +0100
+++ ethercat-devel-r1667/master/master.c	2009-03-06 19:32:57.000000000 +0100
@@ -202,7 +202,11 @@
     if (ret)
         goto out_clear_fsm;
     
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 26)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27)
+    master->class_device = device_create(class, NULL,
+            MKDEV(MAJOR(device_number), master->index), NULL,
+            "EtherCAT%u", master->index);
+#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 26)
     master->class_device = device_create(class, NULL,
             MKDEV(MAJOR(device_number), master->index),
             "EtherCAT%u", master->index);
_______________________________________________
etherlab-users mailing list
[email protected]
http://lists.etherlab.org/mailman/listinfo/etherlab-users

Reply via email to