packages: clean up the package folder
[openwrt.git] / package / kernel / ar7-atm / patches-D7.04.03.00 / 190-2.6.32_proc_fixes.patch
1 --- a/tn7dsl.c
2 +++ b/tn7dsl.c
3 @@ -203,7 +203,11 @@ led_reg_t ledreg[2];
4  static struct led_funcs ledreg[2];
5  #endif
6  
7 +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,33)
8  #define DEV_DSLMOD       CTL_UNNUMBERED
9 +#else
10 +#define DEV_DSLMOD     0
11 +#endif
12  #define MAX_STR_SIZE     256
13  #define DSL_MOD_SIZE     256
14  
15 @@ -3431,9 +3435,16 @@ static int dslmod_sysctl(ctl_table *ctl,
16     */
17    if(write)
18      {
19 +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,32)
20      ret = proc_dostring(ctl, write, filp, buffer, lenp, 0);
21 -
22 +#else
23 +    ret = proc_dostring(ctl, write, buffer, lenp, 0);
24 +#endif
25 +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,33)
26      switch (ctl->ctl_name)
27 +#else
28 +    switch ((long)ctl->extra2)
29 +#endif
30        {
31        case DEV_DSLMOD:
32        ptr = strpbrk(info, " \t");
33 @@ -3517,14 +3528,29 @@ static int dslmod_sysctl(ctl_table *ctl,
34    else
35      {
36      len += sprintf(info+len, mod_req);
37 +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,32)
38      ret = proc_dostring(ctl, write, filp, buffer, lenp, 0);
39 +#else
40 +    ret = proc_dostring(ctl, write, buffer, lenp, 0);
41 +#endif
42      }
43    return ret;
44  }
45  
46  
47  ctl_table dslmod_table[] = {
48 +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,33)
49    {DEV_DSLMOD, "dslmod", info, DSL_MOD_SIZE, 0644, NULL, NULL, &dslmod_sysctl, &sysctl_string}
50 +#else
51 +       {
52 +               .procname               = "dslmod",
53 +               .data                   = info,
54 +               .maxlen                 = DSL_MOD_SIZE,
55 +               .mode                   = 0644,
56 +               .proc_handler   = &dslmod_sysctl,
57 +               .extra2                 = (void *)DEV_DSLMOD,
58 +       }
59 +#endif
60    ,
61    {0}
62    };
63 @@ -3532,7 +3558,16 @@ ctl_table dslmod_table[] = {
64  /* Make sure that /proc/sys/dev is there */
65  ctl_table dslmod_root_table[] = {
66  #ifdef CONFIG_PROC_FS
67 +       #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,33)
68    {CTL_DEV, "dev", NULL, 0, 0555, dslmod_table}
69 +       #else
70 +       {
71 +               .procname               = "dev",
72 +               .maxlen                 = 0,
73 +               .mode                   = 0555,
74 +               .child                  = dslmod_table,
75 +       }
76 +       #endif
77    ,
78  #endif /* CONFIG_PROC_FS */
79    {0}