X-Git-Url: http://rtime.felk.cvut.cz/gitweb/lincan.git/blobdiff_plain/6d1158545bf86bf3478a1e247d6c3d80b8e4ed13..11efb0a892b088eb448635058b2547ecc6f121fd:/lincan/src/proc.c diff --git a/lincan/src/proc.c b/lincan/src/proc.c index 98fbb80..a851830 100644 --- a/lincan/src/proc.c +++ b/lincan/src/proc.c @@ -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;