aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/frv/kernel/pm.c106
-rw-r--r--arch/frv/kernel/sysctl.c3
2 files changed, 2 insertions, 107 deletions
diff --git a/arch/frv/kernel/pm.c b/arch/frv/kernel/pm.c
index 17e2e3fb547d..940d8bb486f8 100644
--- a/arch/frv/kernel/pm.c
+++ b/arch/frv/kernel/pm.c
@@ -211,37 +211,6 @@ static int cmode_procctl(ctl_table *ctl, int write,
211 return try_set_cmode(new_cmode)?:*lenp; 211 return try_set_cmode(new_cmode)?:*lenp;
212} 212}
213 213
214static int cmode_sysctl(ctl_table *table,
215 void __user *oldval, size_t __user *oldlenp,
216 void __user *newval, size_t newlen)
217{
218 if (oldval && oldlenp) {
219 size_t oldlen;
220
221 if (get_user(oldlen, oldlenp))
222 return -EFAULT;
223
224 if (oldlen != sizeof(int))
225 return -EINVAL;
226
227 if (put_user(clock_cmode_current, (unsigned __user *)oldval) ||
228 put_user(sizeof(int), oldlenp))
229 return -EFAULT;
230 }
231 if (newval && newlen) {
232 int new_cmode;
233
234 if (newlen != sizeof(int))
235 return -EINVAL;
236
237 if (get_user(new_cmode, (int __user *)newval))
238 return -EFAULT;
239
240 return try_set_cmode(new_cmode)?:1;
241 }
242 return 1;
243}
244
245static int try_set_p0(int new_p0) 214static int try_set_p0(int new_p0)
246{ 215{
247 unsigned long flags, clkc; 216 unsigned long flags, clkc;
@@ -314,37 +283,6 @@ static int p0_procctl(ctl_table *ctl, int write,
314 return try_set_p0(new_p0)?:*lenp; 283 return try_set_p0(new_p0)?:*lenp;
315} 284}
316 285
317static int p0_sysctl(ctl_table *table,
318 void __user *oldval, size_t __user *oldlenp,
319 void __user *newval, size_t newlen)
320{
321 if (oldval && oldlenp) {
322 size_t oldlen;
323
324 if (get_user(oldlen, oldlenp))
325 return -EFAULT;
326
327 if (oldlen != sizeof(int))
328 return -EINVAL;
329
330 if (put_user(clock_p0_current, (unsigned __user *)oldval) ||
331 put_user(sizeof(int), oldlenp))
332 return -EFAULT;
333 }
334 if (newval && newlen) {
335 int new_p0;
336
337 if (newlen != sizeof(int))
338 return -EINVAL;
339
340 if (get_user(new_p0, (int __user *)newval))
341 return -EFAULT;
342
343 return try_set_p0(new_p0)?:1;
344 }
345 return 1;
346}
347
348static int cm_procctl(ctl_table *ctl, int write, 286static int cm_procctl(ctl_table *ctl, int write,
349 void __user *buffer, size_t *lenp, loff_t *fpos) 287 void __user *buffer, size_t *lenp, loff_t *fpos)
350{ 288{
@@ -358,42 +296,9 @@ static int cm_procctl(ctl_table *ctl, int write,
358 return try_set_cm(new_cm)?:*lenp; 296 return try_set_cm(new_cm)?:*lenp;
359} 297}
360 298
361static int cm_sysctl(ctl_table *table,
362 void __user *oldval, size_t __user *oldlenp,
363 void __user *newval, size_t newlen)
364{
365 if (oldval && oldlenp) {
366 size_t oldlen;
367
368 if (get_user(oldlen, oldlenp))
369 return -EFAULT;
370
371 if (oldlen != sizeof(int))
372 return -EINVAL;
373
374 if (put_user(clock_cm_current, (unsigned __user *)oldval) ||
375 put_user(sizeof(int), oldlenp))
376 return -EFAULT;
377 }
378 if (newval && newlen) {
379 int new_cm;
380
381 if (newlen != sizeof(int))
382 return -EINVAL;
383
384 if (get_user(new_cm, (int __user *)newval))
385 return -EFAULT;
386
387 return try_set_cm(new_cm)?:1;
388 }
389 return 1;
390}
391
392
393static struct ctl_table pm_table[] = 299static struct ctl_table pm_table[] =
394{ 300{
395 { 301 {
396 .ctl_name = CTL_UNNUMBERED,
397 .procname = "suspend", 302 .procname = "suspend",
398 .data = NULL, 303 .data = NULL,
399 .maxlen = 0, 304 .maxlen = 0,
@@ -401,44 +306,37 @@ static struct ctl_table pm_table[] =
401 .proc_handler = &sysctl_pm_do_suspend, 306 .proc_handler = &sysctl_pm_do_suspend,
402 }, 307 },
403 { 308 {
404 .ctl_name = CTL_PM_CMODE,
405 .procname = "cmode", 309 .procname = "cmode",
406 .data = &clock_cmode_current, 310 .data = &clock_cmode_current,
407 .maxlen = sizeof(int), 311 .maxlen = sizeof(int),
408 .mode = 0644, 312 .mode = 0644,
409 .proc_handler = &cmode_procctl, 313 .proc_handler = &cmode_procctl,
410 .strategy = &cmode_sysctl,
411 }, 314 },
412 { 315 {
413 .ctl_name = CTL_PM_P0,
414 .procname = "p0", 316 .procname = "p0",
415 .data = &clock_p0_current, 317 .data = &clock_p0_current,
416 .maxlen = sizeof(int), 318 .maxlen = sizeof(int),
417 .mode = 0644, 319 .mode = 0644,
418 .proc_handler = &p0_procctl, 320 .proc_handler = &p0_procctl,
419 .strategy = &p0_sysctl,
420 }, 321 },
421 { 322 {
422 .ctl_name = CTL_PM_CM,
423 .procname = "cm", 323 .procname = "cm",
424 .data = &clock_cm_current, 324 .data = &clock_cm_current,
425 .maxlen = sizeof(int), 325 .maxlen = sizeof(int),
426 .mode = 0644, 326 .mode = 0644,
427 .proc_handler = &cm_procctl, 327 .proc_handler = &cm_procctl,
428 .strategy = &cm_sysctl,
429 }, 328 },
430 { .ctl_name = 0} 329 { }
431}; 330};
432 331
433static struct ctl_table pm_dir_table[] = 332static struct ctl_table pm_dir_table[] =
434{ 333{
435 { 334 {
436 .ctl_name = CTL_PM,
437 .procname = "pm", 335 .procname = "pm",
438 .mode = 0555, 336 .mode = 0555,
439 .child = pm_table, 337 .child = pm_table,
440 }, 338 },
441 { .ctl_name = 0} 339 { }
442}; 340};
443 341
444/* 342/*
diff --git a/arch/frv/kernel/sysctl.c b/arch/frv/kernel/sysctl.c
index 139628afea17..b30a4f2cda3e 100644
--- a/arch/frv/kernel/sysctl.c
+++ b/arch/frv/kernel/sysctl.c
@@ -176,7 +176,6 @@ static int procctl_frv_pin_cxnr(ctl_table *table, int write, struct file *filp,
176static struct ctl_table frv_table[] = 176static struct ctl_table frv_table[] =
177{ 177{
178 { 178 {
179 .ctl_name = CTL_UNNUMBERD,
180 .procname = "cache-mode", 179 .procname = "cache-mode",
181 .data = NULL, 180 .data = NULL,
182 .maxlen = 0, 181 .maxlen = 0,
@@ -185,7 +184,6 @@ static struct ctl_table frv_table[] =
185 }, 184 },
186#ifdef CONFIG_MMU 185#ifdef CONFIG_MMU
187 { 186 {
188 .ctl_name = CTL_UNNUMBERD,
189 .procname = "pin-cxnr", 187 .procname = "pin-cxnr",
190 .data = NULL, 188 .data = NULL,
191 .maxlen = 0, 189 .maxlen = 0,
@@ -203,7 +201,6 @@ static struct ctl_table frv_table[] =
203static struct ctl_table frv_dir_table[] = 201static struct ctl_table frv_dir_table[] =
204{ 202{
205 { 203 {
206 .ctl_name = CTL_UNNUMBERED,
207 .procname = "frv", 204 .procname = "frv",
208 .mode = 0555, 205 .mode = 0555,
209 .child = frv_table 206 .child = frv_table