]> rtime.felk.cvut.cz Git - lincan.git/blobdiff - lincan/src/proc.c
Updates to compile with 2.6.26 Linux kernel.
[lincan.git] / lincan / src / proc.c
index 98fbb80716f576d397094a354130410efc847482..a85183091047a6d11aac40ee9b660da7cbb28583 100644 (file)
@@ -25,6 +25,12 @@ int remove_object_from_procdir(int chip_nr);
 static int can_proc_readlink(struct proc_dir_entry *ent, char *page);
 #endif
 
+#if  LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,25)
+#define CAN_PROC_ROOT (&proc_root)
+#else /* >= 2.6.26 */
+#define CAN_PROC_ROOT (NULL)
+#endif /* >= 2.6.26 */
+
 static int cc=0; /* static counter for each CAN chip */
 
 static struct canproc_t can_proc_base;
@@ -150,7 +156,7 @@ int can_init_procdir(void)
        int board;
        struct candevice_t *candev;
        base->can_proc_entry = can_create_proc_entry("can", S_IFDIR | S_IRUGO | 
-                                       S_IXUGO, &proc_root);
+                                       S_IXUGO, CAN_PROC_ROOT);
        if (base->can_proc_entry == NULL)
                return -ENODEV;
 
@@ -168,7 +174,7 @@ int can_delete_procdir(void)
        if (remove_channel_from_procdir()) 
                return -ENODEV;
        /* name: "can" */
-       if (can_remove_proc_entry(base->can_proc_entry, &proc_root)) 
+       if (can_remove_proc_entry(base->can_proc_entry, CAN_PROC_ROOT)) 
                return -ENODEV;
 
        return 0;