]> rtime.felk.cvut.cz Git - lincan.git/commitdiff
Simple change to compile LinCAN driver with 2.6.28+ kernels.
authorppisa <ppisa>
Sun, 1 Mar 2009 11:34:26 +0000 (11:34 +0000)
committerppisa <ppisa>
Sun, 1 Mar 2009 11:34:26 +0000 (11:34 +0000)
lincan/src/main.c

index 6463147c9196ee6b42eaa2972029437b117a03bc..df2e84cb6be56450d8ea517f0ac6f053491c87bc 100644 (file)
@@ -369,9 +369,11 @@ int init_module(void)
                        this_dev=class_device_create(can_class, MKDEV(major, dev_minor), NULL,  "can%d", dev_minor);
                      #elif  LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,25) /* >= 2.6.15 */
                        this_dev=class_device_create(can_class, NULL, MKDEV(major, dev_minor), NULL,  "can%d", dev_minor);
                        this_dev=class_device_create(can_class, MKDEV(major, dev_minor), NULL,  "can%d", dev_minor);
                      #elif  LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,25) /* >= 2.6.15 */
                        this_dev=class_device_create(can_class, NULL, MKDEV(major, dev_minor), NULL,  "can%d", dev_minor);
-                     #else /* >= 2.6.26 */
+                     #elif  LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,27)
                        this_dev=device_create_drvdata(can_class, NULL, MKDEV(major, dev_minor), objects_p[i],  "can%d", dev_minor);
                        this_dev=device_create_drvdata(can_class, NULL, MKDEV(major, dev_minor), objects_p[i],  "can%d", dev_minor);
-                     #endif /* >= 2.6.26 */
+                     #else /* >= 2.6.28 */
+                       this_dev=device_create(can_class, NULL, MKDEV(major, dev_minor), objects_p[i],  "can%d", dev_minor);
+                     #endif /* >= 2.6.28 */
                        if(IS_ERR(this_dev)){
                                CANMSG("problem to create device \"can%d\" in the class \"can\"\n", dev_minor);
                      #if  LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,25)
                        if(IS_ERR(this_dev)){
                                CANMSG("problem to create device \"can%d\" in the class \"can\"\n", dev_minor);
                      #if  LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,25)