summaryrefslogtreecommitdiff
path: root/drivers/parport/procfs.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/parport/procfs.c')
-rw-r--r--drivers/parport/procfs.c28
1 files changed, 11 insertions, 17 deletions
diff --git a/drivers/parport/procfs.c b/drivers/parport/procfs.c
index 7aa99c65b934..bd388560ed59 100644
--- a/drivers/parport/procfs.c
+++ b/drivers/parport/procfs.c
@@ -252,8 +252,12 @@ PARPORT_MAX_SPINTIME_VALUE;
struct parport_sysctl_table {
struct ctl_table_header *port_header;
struct ctl_table_header *devices_header;
- struct ctl_table vars[12];
- struct ctl_table device_dir[2];
+#ifdef CONFIG_PARPORT_1284
+ struct ctl_table vars[10];
+#else
+ struct ctl_table vars[5];
+#endif /* IEEE 1284 support */
+ struct ctl_table device_dir[1];
};
static const struct parport_sysctl_table parport_sysctl_template = {
@@ -334,7 +338,6 @@ static const struct parport_sysctl_table parport_sysctl_template = {
.proc_handler = do_autoprobe
},
#endif /* IEEE 1284 support */
- {}
},
{
{
@@ -344,19 +347,14 @@ static const struct parport_sysctl_table parport_sysctl_template = {
.mode = 0444,
.proc_handler = do_active_device
},
- {}
},
};
struct parport_device_sysctl_table
{
struct ctl_table_header *sysctl_header;
- struct ctl_table vars[2];
- struct ctl_table device_dir[2];
- struct ctl_table devices_root_dir[2];
- struct ctl_table port_dir[2];
- struct ctl_table parport_dir[2];
- struct ctl_table dev_dir[2];
+ struct ctl_table vars[1];
+ struct ctl_table device_dir[1];
};
static const struct parport_device_sysctl_table
@@ -372,7 +370,6 @@ parport_device_sysctl_template = {
.extra1 = (void*) &parport_min_timeslice_value,
.extra2 = (void*) &parport_max_timeslice_value
},
- {}
},
{
{
@@ -381,17 +378,13 @@ parport_device_sysctl_template = {
.maxlen = 0,
.mode = 0555,
},
- {}
}
};
struct parport_default_sysctl_table
{
struct ctl_table_header *sysctl_header;
- struct ctl_table vars[3];
- struct ctl_table default_dir[2];
- struct ctl_table parport_dir[2];
- struct ctl_table dev_dir[2];
+ struct ctl_table vars[2];
};
static struct parport_default_sysctl_table
@@ -416,7 +409,6 @@ parport_default_sysctl_table = {
.extra1 = (void*) &parport_min_spintime_value,
.extra2 = (void*) &parport_max_spintime_value
},
- {}
}
};
@@ -435,7 +427,9 @@ int parport_proc_register(struct parport *port)
t->vars[0].data = &port->spintime;
for (i = 0; i < 5; i++) {
t->vars[i].extra1 = port;
+#ifdef CONFIG_PARPORT_1284
t->vars[5 + i].extra2 = &port->probe_info[i];
+#endif /* IEEE 1284 support */
}
tmp_dir_path = kasprintf(GFP_KERNEL, "dev/parport/%s/devices", port->name);