Skip to content

Commit 88eddb0

Browse files
committed
uevent: mv uevent_helper into kobject_uevent.c
Move both uevent_helper table into lib/kobject_uevent.c. Place the registration early in the initcall order with postcore_initcall. This is part of a greater effort to move ctl tables into their respective subsystems which will reduce the merge conflicts in kernel/sysctl.c. Signed-off-by: Joel Granados <[email protected]>
1 parent 39dac31 commit 88eddb0

File tree

2 files changed

+20
-9
lines changed

2 files changed

+20
-9
lines changed

kernel/sysctl.c

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1474,15 +1474,6 @@ static const struct ctl_table kern_table[] = {
14741474
.mode = 0644,
14751475
.proc_handler = proc_dointvec,
14761476
},
1477-
#endif
1478-
#ifdef CONFIG_UEVENT_HELPER
1479-
{
1480-
.procname = "hotplug",
1481-
.data = &uevent_helper,
1482-
.maxlen = UEVENT_HELPER_PATH_LEN,
1483-
.mode = 0644,
1484-
.proc_handler = proc_dostring,
1485-
},
14861477
#endif
14871478
{
14881479
.procname = "overflowuid",

lib/kobject_uevent.c

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -826,3 +826,23 @@ static int __init kobject_uevent_init(void)
826826

827827
postcore_initcall(kobject_uevent_init);
828828
#endif
829+
830+
#ifdef CONFIG_UEVENT_HELPER
831+
static const struct ctl_table uevent_helper_sysctl_table[] = {
832+
{
833+
.procname = "hotplug",
834+
.data = &uevent_helper,
835+
.maxlen = UEVENT_HELPER_PATH_LEN,
836+
.mode = 0644,
837+
.proc_handler = proc_dostring,
838+
},
839+
};
840+
841+
static int __init init_uevent_helper_sysctl(void)
842+
{
843+
register_sysctl_init("kernel", uevent_helper_sysctl_table);
844+
return 0;
845+
}
846+
847+
postcore_initcall(init_uevent_helper_sysctl);
848+
#endif

0 commit comments

Comments
 (0)