]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
kernel: param: initialize module_kset in a pure_initcall
authorShashank Balaji <shashank.mahadasyam@sony.com>
Mon, 1 Jun 2026 10:19:41 +0000 (19:19 +0900)
committerDanilo Krummrich <dakr@kernel.org>
Mon, 8 Jun 2026 21:27:56 +0000 (23:27 +0200)
commitc82dfce478334dca4e9a42c4519a55ee2a2c43c7
tree638eef03ac4406ba58bfe3d0723cfff88d807730
parentcd6e95e7ab29c4f67475e3eafef6f836f06eb0e8
kernel: param: initialize module_kset in a pure_initcall

Commit "driver core: platform: set mod_name in driver registration" will
set struct device_driver's mod_name member for platform driver
registration. For a driver to be registered with its mod_name set,
module_kset needs to be initialized, which currently happens in a
subsys_initcall in param_sysfs_init().  The tegra cbb drivers register
themselves before module_kset init, in a core_initcall. This works
currently because lookup_or_create_module_kobject(), which dereferences
module_kset via kset_find_obj(), is not called if mod_name is not set,
which is the case now.

So in preparation for the commit "driver core: platform: set mod_name in
driver registration", move module_kset init to pure_initcall level,
ensuring it happens before tegra cbb driver registration.

Suggested-by: Gary Guo <gary@garyguo.net>
Reviewed-by: Gary Guo <gary@garyguo.net>
Co-developed-by: Rahul Bukte <rahul.bukte@sony.com>
Signed-off-by: Rahul Bukte <rahul.bukte@sony.com>
Signed-off-by: Shashank Balaji <shashank.mahadasyam@sony.com>
Link: https://patch.msgid.link/20260601101942.4002661-1-shashank.mahadasyam@sony.com
Signed-off-by: Danilo Krummrich <dakr@kernel.org>
kernel/params.c