From 38f01e764d636568fd0c8f97cd679d88c8ce7cd9 Mon Sep 17 00:00:00 2001 From: ppisa Date: Sun, 1 Mar 2009 11:47:27 +0100 Subject: [PATCH 1/1] Regitration of USB driver targets updated for 2.6.28+ kernels as well. --- lincan/src/main.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lincan/src/main.c b/lincan/src/main.c index 52cec59..3aa24fa 100644 --- a/lincan/src/main.c +++ b/lincan/src/main.c @@ -540,9 +540,11 @@ struct candevice_t* register_usbdev(const char *hwname,void *devdata,void (*chip 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); - #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) -- 2.39.2