kmod-sched-cake: bump to 20180827
[openwrt/staging/wigyori.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 @@ -197,7 +197,7 @@ led_reg_t ledreg[2];
4 static struct led_funcs ledreg[2];
5 #endif
6
7 -#define DEV_DSLMOD CTL_UNNUMBERED
8 +#define DEV_DSLMOD 0
9 #define MAX_STR_SIZE 256
10 #define DSL_MOD_SIZE 256
11
12 @@ -333,8 +333,8 @@ static void tn7dsl_chng_modulation(void*
13 static unsigned int tn7dsl_set_modulation(void* data, int flag);
14 static void tn7dsl_ctrl_fineGain(int value);
15 static void tn7dsl_set_fineGainValue(int value);
16 -static int dslmod_sysctl (ctl_table * ctl, int write, struct file *filp,
17 - void *buffer, size_t * lenp);
18 +static int dslmod_sysctl (ctl_table * ctl, int write, void *buffer,
19 + size_t * lenp, loff_t *ppos);
20 static void tn7dsl_register_dslss_led(void);
21 void tn7dsl_dslmod_sysctl_register(void);
22 void tn7dsl_dslmod_sysctl_unregister(void);
23 @@ -3398,8 +3398,8 @@ unsigned int tn7dsl_get_memory(unsigned
24
25
26
27 -static int dslmod_sysctl(ctl_table *ctl, int write, struct file * filp,
28 - void *buffer, size_t *lenp)
29 +static int dslmod_sysctl(ctl_table *ctl, int write, void *buffer,
30 + size_t *lenp, loff_t *ppos)
31 {
32 char *ptr;
33 int ret, len = 0;
34 @@ -3411,7 +3411,7 @@ static int dslmod_sysctl(ctl_table *ctl,
35 char mod_req[16] = { '\t' };
36 char fst_byt;
37
38 - if (!*lenp || (filp->f_pos && !write))
39 + if (!*lenp || (*ppos && !write))
40 {
41 *lenp = 0;
42 return 0;
43 @@ -3421,9 +3421,9 @@ static int dslmod_sysctl(ctl_table *ctl,
44 */
45 if(write)
46 {
47 - ret = proc_dostring(ctl, write, filp, buffer, lenp, 0);
48 + ret = proc_dostring(ctl, write, buffer, lenp, ppos);
49
50 - switch (ctl->ctl_name)
51 + switch ((long)ctl->extra2)
52 {
53 case DEV_DSLMOD:
54 ptr = strpbrk(info, " \t");
55 @@ -3507,14 +3507,21 @@ static int dslmod_sysctl(ctl_table *ctl,
56 else
57 {
58 len += sprintf(info+len, mod_req);
59 - ret = proc_dostring(ctl, write, filp, buffer, lenp, 0);
60 + ret = proc_dostring(ctl, write, buffer, lenp, ppos);
61 }
62 return ret;
63 }
64
65
66 ctl_table dslmod_table[] = {
67 - {DEV_DSLMOD, "dslmod", info, DSL_MOD_SIZE, 0644, NULL, NULL, &dslmod_sysctl, &sysctl_string}
68 + {
69 + .procname = "dslmod",
70 + .data = info,
71 + .maxlen = DSL_MOD_SIZE,
72 + .mode = 0644,
73 + .proc_handler = &dslmod_sysctl,
74 + .extra2 = (void *)DEV_DSLMOD,
75 + }
76 ,
77 {0}
78 };
79 @@ -3522,7 +3529,12 @@ ctl_table dslmod_table[] = {
80 /* Make sure that /proc/sys/dev is there */
81 ctl_table dslmod_root_table[] = {
82 #ifdef CONFIG_PROC_FS
83 - {CTL_DEV, "dev", NULL, 0, 0555, dslmod_table}
84 + {
85 + .procname = "dev",
86 + .maxlen = 0,
87 + .mode = 0555,
88 + .child = dslmod_table,
89 + }
90 ,
91 #endif /* CONFIG_PROC_FS */
92 {0}