1 --- codec_engine_2_21_00_06/cetools/packages/ti/sdo/linuxutils/cmem/src/module/cmemk.c 2008-09-26 02:26:04.000000000 +0200
2 +++ codec_engine_2_21_00_06/cetools/packages/ti/sdo/linuxutils/cmem/src/module/cmemk.c 2008-10-30 11:57:54.000000000 +0100
4 * USE_CLASS_SIMPLE - #define if Linux version contains class_simple,
5 * otherwise class is used (Linux supports one or the other, not both)
7 -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,18)
8 +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,26)
10 -#warning LINUX_VERSION_CODE >= 2.6.18
11 +#warning LINUX_VERSION_CODE >= 2.6.26
13 +#define USE_CACHE_VOID_ARG
14 +#undef USE_CLASS_DEVICE
15 +#undef USE_CLASS_SIMPLE
17 +#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,18)
19 +#warning 2.6.26 > LINUX_VERSION_CODE >= 2.6.18
21 #define USE_CACHE_VOID_ARG
22 +#define USE_CLASS_DEVICE
23 #undef USE_CLASS_SIMPLE
25 #else /* LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,18) */
27 #warning LINUX_VERSION_CODE < 2.6.18
29 #define USE_CLASS_SIMPLE
30 +#undef USE_CLASS_DEVICE
31 #undef USE_CACHE_VOID_ARG
33 #endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,18) */
34 @@ -1697,12 +1691,12 @@
35 #ifdef USE_CLASS_SIMPLE
36 class_simple_device_add(cmem_class, MKDEV(cmem_major, 0), NULL, "cmem");
39 - Use the following for newer GIT releases ( > 2.6.25?)
40 - device_create(cmem_class, NULL, MKDEV(cmem_major, 0), "cmem");
42 +#ifdef USE_CLASS_DEVICE
43 class_device_create(cmem_class, NULL, MKDEV(cmem_major, 0), NULL, "cmem");
46 + device_create(cmem_class, NULL, MKDEV(cmem_major, 0), "cmem");
47 +#endif // USE_CLASS_DEVICE
48 +#endif // USE_CLASS_SIMPLE
51 pstart[0] = phys_start;
52 @@ -1862,13 +1856,13 @@
53 class_simple_device_remove(MKDEV(cmem_major, 0));
54 class_simple_destroy(cmem_class);
57 - Use the following for newer GIT releases ( > 2.6.25?)
58 - device_destroy(cmem_class, MKDEV(cmem_major, 0));
60 +#ifdef USE_CLASS_DEVICE
61 class_device_destroy(cmem_class, MKDEV(cmem_major, 0));
63 + device_destroy(cmem_class, MKDEV(cmem_major, 0));
64 +#endif // USE_CLASS_DEVICE
65 class_destroy(cmem_class);
67 +#endif // USE_CLASS_SIMPLE
71 @@ -1938,13 +1932,13 @@
72 class_simple_device_remove(MKDEV(cmem_major, 0));
73 class_simple_destroy(cmem_class);
76 - Use the following for newer GIT releases ( > 2.6.25?)
77 - device_destroy(cmem_class, MKDEV(cmem_major, 0));
79 +#ifdef USE_CLASS_DEVICE
80 class_device_destroy(cmem_class, MKDEV(cmem_major, 0));
82 + device_destroy(cmem_class, MKDEV(cmem_major, 0));
83 +#endif // USE_CLASS_DEVICE
84 class_destroy(cmem_class);
86 +#endif // USE_CLASS_SIMPLE