[PATCH 65/69] sysctl: single subheader path: dev/parport/PORT/devices/DEVICE/

Lucian Adrian Grijincu
2011-05-01T01:44:29Z

This patch was not tested!

Parport registers tables under these paths:
dev/parport/default/
dev/parport/PORT/
dev/parport/PORT/devices/
dev/parport/PORT/devices/DEVICE/

Nothing else is registered below dev/parport/PORT/devices/DEVICE/ and
I assume device names are unique (if they are not this patch is
invalid), so we can skip name checks for the 'DEVICE' directory.

This will have a positive performance impact when there are many
devices registered on the same port.

Signed-off-by: Lucian Adrian Grijincu <lucian.grijincu@gmail.com>
---
drivers/parport/procfs.c | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/drivers/parport/procfs.c b/drivers/parport/procfs.c
index 3bb5bed..9c48946 100644
--- a/drivers/parport/procfs.c
+++ b/drivers/parport/procfs.c
@@ -442,7 +442,12 @@ int parport_device_proc_register(struct pardevice *device)
{ .procname = "parport" },
{ .procname = port->name },
{ .procname = "devices" },
- { .procname = device->name },
+ {
+ .procname = device->name,
+ /* skip duplicate name check; we're registering
+ * just one subheader for this directory */
+ .has_just_one_subheader = 1,
+ },
{ },
};

--
1.7.5.134.g1c08b