summaryrefslogtreecommitdiff
path: root/recipes/ti/files/sdma-class-device-and-includes-fix.patch
blob: 2dcc7a3b7e6ce59004ef3022df24e7191c20fd8f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
diff -uNr codec_engine_2_21/cetools/packages/ti/sdo/linuxutils/sdma/src/module/sdmak.c codec_engine_2_21_fix/cetools/packages/ti/sdo/linuxutils/sdma/src/module/sdmak.c
--- codec_engine_2_21/cetools/packages/ti/sdo/linuxutils/sdma/src/module/sdmak.c        2009-02-20 14:49:41.000000000 +0000
+++ codec_engine_2_21_fix/cetools/packages/ti/sdo/linuxutils/sdma/src/module/sdmak.c    2009-02-20 15:07:59.000000000 +0000
@@ -17,6 +17,7 @@
 /*
  * sdmak.c
  */
+#include <linux/version.h>
 #include <linux/kernel.h>
 #include <linux/sched.h>
 #include <linux/module.h>
@@ -32,14 +33,20 @@
 #include <linux/irq.h>
 #include <linux/highmem.h>
 #include <linux/pagemap.h>
-
-#include <asm/arch/dma.h>
 #include <asm/uaccess.h>
 #include <asm/system.h>
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,26)
+#include <asm/arch/dma.h>
 #include <asm/hardware.h>
 #include <asm/dma.h>
-#include <asm/io.h>
 #include <asm/arch/tc.h>
+#else
+#include <asm/dma.h>
+#include <mach/hardware.h>
+#include <mach/dma.h>
+#include <mach/tc.h>
+#endif
+#include <asm/io.h>
 
 #include "../interface/sdma.h"
 
@@ -229,7 +236,11 @@
     __D("sdma registered major = %d\n", major);
 
     dma_class = class_create(THIS_MODULE, "sdma");
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,26)
     class_device_create(dma_class, NULL, MKDEV(major, 0), NULL, "sdma");
+#else
+    device_create(dma_class, NULL, MKDEV(major, 0), NULL, "sdma");
+#endif
 
     for (channel = 0; channel < SDMA_NUMCHANNELS; channel++) {
         channels[channel].owner = NULL;
@@ -248,7 +259,11 @@
             omap_free_dma(channel);
         }
     }
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,26)
     class_device_destroy(dma_class, MKDEV(major, 0));
+#else
+    device_destroy(dma_class, MKDEV(major, 0));
+#endif
     class_destroy(dma_class);
     unregister_chrdev(major, "sdma");