-#if (LINUX_VERSION_CODE <= KERNEL_VERSION(2,5,50))
-#include <linux/wrapper.h>
+#if (LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,0))
+ #include <linux/wrapper.h>
+#else
+ #include <linux/device.h>
+ #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,13)
+ static struct class *can_class;
+ #elif LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
+ static struct class_simple *can_class;
+ #define class_create class_simple_create
+ #define class_device_create class_simple_device_add
+ #define class_device_destroy(a,b) class_simple_device_remove(b)
+ #define class_destroy class_simple_destroy
+ #endif