]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
uevent: mv uevent_helper into kobject_uevent.c
authorJoel Granados <joel.granados@kernel.org>
Fri, 27 Jun 2025 07:29:56 +0000 (09:29 +0200)
committerJoel Granados <joel.granados@kernel.org>
Wed, 23 Jul 2025 09:56:02 +0000 (11:56 +0200)
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 <joel.granados@kernel.org>
kernel/sysctl.c
lib/kobject_uevent.c

index 0716c7df7243dc38f0a49c7cae78651c3f75f5a3..2df63b69edf6fd21a58584d670e75e6f26a6e5cc 100644 (file)
@@ -1474,15 +1474,6 @@ static const struct ctl_table kern_table[] = {
                .mode           = 0644,
                .proc_handler   = proc_dointvec,
        },
-#endif
-#ifdef CONFIG_UEVENT_HELPER
-       {
-               .procname       = "hotplug",
-               .data           = &uevent_helper,
-               .maxlen         = UEVENT_HELPER_PATH_LEN,
-               .mode           = 0644,
-               .proc_handler   = proc_dostring,
-       },
 #endif
        {
                .procname       = "overflowuid",
index b7f2fa08d9c82c2838b703f3fd25f6e43b88b68a..78e16b95d2101a01c442f62ad9b9133f3f8533c2 100644 (file)
@@ -826,3 +826,23 @@ static int __init kobject_uevent_init(void)
 
 postcore_initcall(kobject_uevent_init);
 #endif
+
+#ifdef CONFIG_UEVENT_HELPER
+static const struct ctl_table uevent_helper_sysctl_table[] = {
+       {
+               .procname       = "hotplug",
+               .data           = &uevent_helper,
+               .maxlen         = UEVENT_HELPER_PATH_LEN,
+               .mode           = 0644,
+               .proc_handler   = proc_dostring,
+       },
+};
+
+static int __init init_uevent_helper_sysctl(void)
+{
+       register_sysctl_init("kernel", uevent_helper_sysctl_table);
+       return 0;
+}
+
+postcore_initcall(init_uevent_helper_sysctl);
+#endif