diff options
Diffstat (limited to 'drivers/parport/procfs.c')
-rw-r--r-- | drivers/parport/procfs.c | 39 |
1 files changed, 17 insertions, 22 deletions
diff --git a/drivers/parport/procfs.c b/drivers/parport/procfs.c index 8eefe56f1cbe..3f56bc086cb5 100644 --- a/drivers/parport/procfs.c +++ b/drivers/parport/procfs.c | |||
@@ -233,10 +233,10 @@ static int do_hardware_modes (ctl_table *table, int write, | |||
233 | return copy_to_user(result, buffer, len) ? -EFAULT : 0; | 233 | return copy_to_user(result, buffer, len) ? -EFAULT : 0; |
234 | } | 234 | } |
235 | 235 | ||
236 | #define PARPORT_PORT_DIR(CHILD) { .ctl_name = 0, .procname = NULL, .mode = 0555, .child = CHILD } | 236 | #define PARPORT_PORT_DIR(CHILD) { .procname = NULL, .mode = 0555, .child = CHILD } |
237 | #define PARPORT_PARPORT_DIR(CHILD) { .ctl_name = DEV_PARPORT, .procname = "parport", \ | 237 | #define PARPORT_PARPORT_DIR(CHILD) { .procname = "parport", \ |
238 | .mode = 0555, .child = CHILD } | 238 | .mode = 0555, .child = CHILD } |
239 | #define PARPORT_DEV_DIR(CHILD) { .ctl_name = CTL_DEV, .procname = "dev", .mode = 0555, .child = CHILD } | 239 | #define PARPORT_DEV_DIR(CHILD) { .procname = "dev", .mode = 0555, .child = CHILD } |
240 | #define PARPORT_DEVICES_ROOT_DIR { .procname = "devices", \ | 240 | #define PARPORT_DEVICES_ROOT_DIR { .procname = "devices", \ |
241 | .mode = 0555, .child = NULL } | 241 | .mode = 0555, .child = NULL } |
242 | 242 | ||
@@ -270,7 +270,7 @@ static const struct parport_sysctl_table parport_sysctl_template = { | |||
270 | .data = NULL, | 270 | .data = NULL, |
271 | .maxlen = sizeof(int), | 271 | .maxlen = sizeof(int), |
272 | .mode = 0644, | 272 | .mode = 0644, |
273 | .proc_handler = &proc_dointvec_minmax, | 273 | .proc_handler = proc_dointvec_minmax, |
274 | .extra1 = (void*) &parport_min_spintime_value, | 274 | .extra1 = (void*) &parport_min_spintime_value, |
275 | .extra2 = (void*) &parport_max_spintime_value | 275 | .extra2 = (void*) &parport_max_spintime_value |
276 | }, | 276 | }, |
@@ -279,28 +279,28 @@ static const struct parport_sysctl_table parport_sysctl_template = { | |||
279 | .data = NULL, | 279 | .data = NULL, |
280 | .maxlen = 0, | 280 | .maxlen = 0, |
281 | .mode = 0444, | 281 | .mode = 0444, |
282 | .proc_handler = &do_hardware_base_addr | 282 | .proc_handler = do_hardware_base_addr |
283 | }, | 283 | }, |
284 | { | 284 | { |
285 | .procname = "irq", | 285 | .procname = "irq", |
286 | .data = NULL, | 286 | .data = NULL, |
287 | .maxlen = 0, | 287 | .maxlen = 0, |
288 | .mode = 0444, | 288 | .mode = 0444, |
289 | .proc_handler = &do_hardware_irq | 289 | .proc_handler = do_hardware_irq |
290 | }, | 290 | }, |
291 | { | 291 | { |
292 | .procname = "dma", | 292 | .procname = "dma", |
293 | .data = NULL, | 293 | .data = NULL, |
294 | .maxlen = 0, | 294 | .maxlen = 0, |
295 | .mode = 0444, | 295 | .mode = 0444, |
296 | .proc_handler = &do_hardware_dma | 296 | .proc_handler = do_hardware_dma |
297 | }, | 297 | }, |
298 | { | 298 | { |
299 | .procname = "modes", | 299 | .procname = "modes", |
300 | .data = NULL, | 300 | .data = NULL, |
301 | .maxlen = 0, | 301 | .maxlen = 0, |
302 | .mode = 0444, | 302 | .mode = 0444, |
303 | .proc_handler = &do_hardware_modes | 303 | .proc_handler = do_hardware_modes |
304 | }, | 304 | }, |
305 | PARPORT_DEVICES_ROOT_DIR, | 305 | PARPORT_DEVICES_ROOT_DIR, |
306 | #ifdef CONFIG_PARPORT_1284 | 306 | #ifdef CONFIG_PARPORT_1284 |
@@ -309,35 +309,35 @@ static const struct parport_sysctl_table parport_sysctl_template = { | |||
309 | .data = NULL, | 309 | .data = NULL, |
310 | .maxlen = 0, | 310 | .maxlen = 0, |
311 | .mode = 0444, | 311 | .mode = 0444, |
312 | .proc_handler = &do_autoprobe | 312 | .proc_handler = do_autoprobe |
313 | }, | 313 | }, |
314 | { | 314 | { |
315 | .procname = "autoprobe0", | 315 | .procname = "autoprobe0", |
316 | .data = NULL, | 316 | .data = NULL, |
317 | .maxlen = 0, | 317 | .maxlen = 0, |
318 | .mode = 0444, | 318 | .mode = 0444, |
319 | .proc_handler = &do_autoprobe | 319 | .proc_handler = do_autoprobe |
320 | }, | 320 | }, |
321 | { | 321 | { |
322 | .procname = "autoprobe1", | 322 | .procname = "autoprobe1", |
323 | .data = NULL, | 323 | .data = NULL, |
324 | .maxlen = 0, | 324 | .maxlen = 0, |
325 | .mode = 0444, | 325 | .mode = 0444, |
326 | .proc_handler = &do_autoprobe | 326 | .proc_handler = do_autoprobe |
327 | }, | 327 | }, |
328 | { | 328 | { |
329 | .procname = "autoprobe2", | 329 | .procname = "autoprobe2", |
330 | .data = NULL, | 330 | .data = NULL, |
331 | .maxlen = 0, | 331 | .maxlen = 0, |
332 | .mode = 0444, | 332 | .mode = 0444, |
333 | .proc_handler = &do_autoprobe | 333 | .proc_handler = do_autoprobe |
334 | }, | 334 | }, |
335 | { | 335 | { |
336 | .procname = "autoprobe3", | 336 | .procname = "autoprobe3", |
337 | .data = NULL, | 337 | .data = NULL, |
338 | .maxlen = 0, | 338 | .maxlen = 0, |
339 | .mode = 0444, | 339 | .mode = 0444, |
340 | .proc_handler = &do_autoprobe | 340 | .proc_handler = do_autoprobe |
341 | }, | 341 | }, |
342 | #endif /* IEEE 1284 support */ | 342 | #endif /* IEEE 1284 support */ |
343 | {} | 343 | {} |
@@ -348,7 +348,7 @@ static const struct parport_sysctl_table parport_sysctl_template = { | |||
348 | .data = NULL, | 348 | .data = NULL, |
349 | .maxlen = 0, | 349 | .maxlen = 0, |
350 | .mode = 0444, | 350 | .mode = 0444, |
351 | .proc_handler = &do_active_device | 351 | .proc_handler = do_active_device |
352 | }, | 352 | }, |
353 | {} | 353 | {} |
354 | }, | 354 | }, |
@@ -386,14 +386,13 @@ parport_device_sysctl_template = { | |||
386 | .data = NULL, | 386 | .data = NULL, |
387 | .maxlen = sizeof(unsigned long), | 387 | .maxlen = sizeof(unsigned long), |
388 | .mode = 0644, | 388 | .mode = 0644, |
389 | .proc_handler = &proc_doulongvec_ms_jiffies_minmax, | 389 | .proc_handler = proc_doulongvec_ms_jiffies_minmax, |
390 | .extra1 = (void*) &parport_min_timeslice_value, | 390 | .extra1 = (void*) &parport_min_timeslice_value, |
391 | .extra2 = (void*) &parport_max_timeslice_value | 391 | .extra2 = (void*) &parport_max_timeslice_value |
392 | }, | 392 | }, |
393 | }, | 393 | }, |
394 | { | 394 | { |
395 | { | 395 | { |
396 | .ctl_name = 0, | ||
397 | .procname = NULL, | 396 | .procname = NULL, |
398 | .data = NULL, | 397 | .data = NULL, |
399 | .maxlen = 0, | 398 | .maxlen = 0, |
@@ -438,7 +437,7 @@ parport_default_sysctl_table = { | |||
438 | .data = &parport_default_timeslice, | 437 | .data = &parport_default_timeslice, |
439 | .maxlen = sizeof(parport_default_timeslice), | 438 | .maxlen = sizeof(parport_default_timeslice), |
440 | .mode = 0644, | 439 | .mode = 0644, |
441 | .proc_handler = &proc_doulongvec_ms_jiffies_minmax, | 440 | .proc_handler = proc_doulongvec_ms_jiffies_minmax, |
442 | .extra1 = (void*) &parport_min_timeslice_value, | 441 | .extra1 = (void*) &parport_min_timeslice_value, |
443 | .extra2 = (void*) &parport_max_timeslice_value | 442 | .extra2 = (void*) &parport_max_timeslice_value |
444 | }, | 443 | }, |
@@ -447,7 +446,7 @@ parport_default_sysctl_table = { | |||
447 | .data = &parport_default_spintime, | 446 | .data = &parport_default_spintime, |
448 | .maxlen = sizeof(parport_default_spintime), | 447 | .maxlen = sizeof(parport_default_spintime), |
449 | .mode = 0644, | 448 | .mode = 0644, |
450 | .proc_handler = &proc_dointvec_minmax, | 449 | .proc_handler = proc_dointvec_minmax, |
451 | .extra1 = (void*) &parport_min_spintime_value, | 450 | .extra1 = (void*) &parport_min_spintime_value, |
452 | .extra2 = (void*) &parport_max_spintime_value | 451 | .extra2 = (void*) &parport_max_spintime_value |
453 | }, | 452 | }, |
@@ -455,7 +454,6 @@ parport_default_sysctl_table = { | |||
455 | }, | 454 | }, |
456 | { | 455 | { |
457 | { | 456 | { |
458 | .ctl_name = DEV_PARPORT_DEFAULT, | ||
459 | .procname = "default", | 457 | .procname = "default", |
460 | .mode = 0555, | 458 | .mode = 0555, |
461 | .child = parport_default_sysctl_table.vars | 459 | .child = parport_default_sysctl_table.vars |
@@ -495,7 +493,6 @@ int parport_proc_register(struct parport *port) | |||
495 | t->vars[6 + i].extra2 = &port->probe_info[i]; | 493 | t->vars[6 + i].extra2 = &port->probe_info[i]; |
496 | 494 | ||
497 | t->port_dir[0].procname = port->name; | 495 | t->port_dir[0].procname = port->name; |
498 | t->port_dir[0].ctl_name = 0; | ||
499 | 496 | ||
500 | t->port_dir[0].child = t->vars; | 497 | t->port_dir[0].child = t->vars; |
501 | t->parport_dir[0].child = t->port_dir; | 498 | t->parport_dir[0].child = t->port_dir; |
@@ -534,11 +531,9 @@ int parport_device_proc_register(struct pardevice *device) | |||
534 | t->dev_dir[0].child = t->parport_dir; | 531 | t->dev_dir[0].child = t->parport_dir; |
535 | t->parport_dir[0].child = t->port_dir; | 532 | t->parport_dir[0].child = t->port_dir; |
536 | t->port_dir[0].procname = port->name; | 533 | t->port_dir[0].procname = port->name; |
537 | t->port_dir[0].ctl_name = 0; | ||
538 | t->port_dir[0].child = t->devices_root_dir; | 534 | t->port_dir[0].child = t->devices_root_dir; |
539 | t->devices_root_dir[0].child = t->device_dir; | 535 | t->devices_root_dir[0].child = t->device_dir; |
540 | 536 | ||
541 | t->device_dir[0].ctl_name = 0; | ||
542 | t->device_dir[0].procname = device->name; | 537 | t->device_dir[0].procname = device->name; |
543 | t->device_dir[0].child = t->vars; | 538 | t->device_dir[0].child = t->vars; |
544 | t->vars[0].data = &device->timeslice; | 539 | t->vars[0].data = &device->timeslice; |