4af07da370112f3e2dc2c3bb628a2d83e8ea5367
[openwrt/staging/yousong.git] / package / kernel / lantiq / ltq-vdsl / patches / 100-compat.patch
1 --- a/src/Makefile.in
2 +++ b/src/Makefile.in
3 @@ -63,7 +63,7 @@ POST_UNINSTALL = :
4
5 # the headerfile of linux kernels 2.6.x contain to much arithmetic
6 # with void pointers (which is allowed for gcc!)
7 -@KERNEL_2_6_FALSE@am__append_6 = -Wpointer-arith
8 +@KERNEL_2_6_FALSE@am__append_6 =
9 subdir = src
10 DIST_COMMON = $(drv_dsl_cpe_api_include_HEADERS) $(srcdir)/Makefile.am \
11 $(srcdir)/Makefile.in
12 --- a/src/common/drv_dsl_cpe_os_linux.c
13 +++ b/src/common/drv_dsl_cpe_os_linux.c
14 @@ -11,6 +11,7 @@
15
16 #define DSL_INTERN
17
18 +#include <linux/device.h>
19 #include "drv_dsl_cpe_api.h"
20 #include "drv_dsl_cpe_api_ioctl.h"
21
22 @@ -238,14 +239,7 @@ static DSL_long_t DSL_DRV_Ioctls(DSL_DRV
23 }
24
25 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36))
26 - if (pFile->f_dentry != DSL_NULL)
27 - {
28 - pINode = pFile->f_dentry->d_inode;
29 - }
30 - else
31 - {
32 - pINode = DSL_NULL;
33 - }
34 + pINode = file_inode(pFile);
35 #endif
36
37 if (pINode == DSL_NULL)
38 @@ -1118,6 +1112,9 @@ static void DSL_DRV_DebugInit(void)
39 return;
40 }
41
42 +static struct class *dsl_class;
43 +static dev_t dsl_devt;
44 +
45 /* Entry point of driver */
46 int __init DSL_ModuleInit(void)
47 {
48 @@ -1156,6 +1153,10 @@ int __init DSL_ModuleInit(void)
49
50 DSL_DRV_DevNodeInit();
51
52 + dsl_class = class_create(THIS_MODULE, "dsl_cpe_api0");
53 + dsl_devt = MKDEV(DRV_DSL_CPE_API_DEV_MAJOR, 0);
54 + device_create(dsl_class, NULL, dsl_devt, NULL, "dsl_cpe_api0");
55 +
56 return 0;
57 }
58
59 @@ -1163,6 +1164,11 @@ void __exit DSL_ModuleCleanup(void)
60 {
61 printk("Module will be unloaded"DSL_DRV_CRLF);
62
63 + device_destroy(dsl_class, dsl_devt);
64 + dsl_devt = NULL;
65 + class_destroy(dsl_class);
66 + dsl_class = NULL;
67 +
68 unregister_chrdev(nMajorNum, DRV_DSL_CPE_API_DEV_NAME);
69
70 DSL_DRV_Cleanup();