# \[v2 013/115\] sysctl: remove .child from dev/mac\_hid/

- From: Lucian Adrian Grijincu \<hidden\>
- Date: 2011-05-08 23:04:23 
- List: netdev
- Page: https://ratatoskr.run/netdev/2011/05/3712458
- Thread: https://ratatoskr.run/netdev/2011/05/3712445/t/2.md

```text
Signed-off-by: Lucian Adrian Grijincu <redacted>
---
 drivers/macintosh/mac_hid.c |   26 +++++---------------------
 1 files changed, 5 insertions(+), 21 deletions(-)

diff --git a/drivers/macintosh/mac_hid.c b/drivers/macintosh/mac_hid.c
index 6a82388..5eec7b7 100644
--- a/drivers/macintosh/mac_hid.c
+++ b/drivers/macintosh/mac_hid.c
@@ -214,7 +214,7 @@ static int mac_hid_toggle_emumouse(ctl_table *table, int write,
 }
 
 /* file(s) in /proc/sys/dev/mac_hid */
-static ctl_table mac_hid_files[] = {
+static ctl_table mac_hid_table[] = {
 	{
 		.procname	= "mouse_button_emulation",
 		.data		= &mouse_emulate_buttons,
@@ -239,25 +239,9 @@ static ctl_table mac_hid_files[] = {
 	{ }
 };
 
-/* dir in /proc/sys/dev */
-static ctl_table mac_hid_dir[] = {
-	{
-		.procname	= "mac_hid",
-		.maxlen		= 0,
-		.mode		= 0555,
-		.child		= mac_hid_files,
-	},
-	{ }
-};
-
-/* /proc/sys/dev itself, in case that is not there yet */
-static ctl_table mac_hid_root_dir[] = {
-	{
-		.procname	= "dev",
-		.maxlen		= 0,
-		.mode		= 0555,
-		.child		= mac_hid_dir,
-	},
+static const __initdata struct ctl_path mac_hid_path[] = {
+	{ .procname = "dev" },
+	{ .procname = "mac_hid" },
 	{ }
 };
 
@@ -265,7 +249,7 @@ static struct ctl_table_header *mac_hid_sysctl_header;
 
 static int __init mac_hid_init(void)
 {
-	mac_hid_sysctl_header = register_sysctl_table(mac_hid_root_dir);
+	mac_hid_sysctl_header = register_sysctl_paths(mac_hid_path, mac_hid_table);
 	if (!mac_hid_sysctl_header)
 		return -ENOMEM;
 
-- 
1.7.5.134.g1c08b
```
