]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
kernel: globalize lookup_or_create_module_kobject()
authorShyam Saini <shyamsaini@linux.microsoft.com>
Thu, 27 Feb 2025 18:49:29 +0000 (10:49 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 9 May 2025 07:44:07 +0000 (09:44 +0200)
[ Upstream commit 7c76c813cfc42a7376378a0c4b7250db2eebab81 ]

lookup_or_create_module_kobject() is marked as static and __init,
to make it global drop static keyword.
Since this function can be called from non-init code, use __modinit
instead of __init, __modinit marker will make it __init if
CONFIG_MODULES is not defined.

Suggested-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Signed-off-by: Shyam Saini <shyamsaini@linux.microsoft.com>
Link: https://lore.kernel.org/r/20250227184930.34163-4-shyamsaini@linux.microsoft.com
Signed-off-by: Petr Pavlu <petr.pavlu@suse.com>
Stable-dep-of: f95bbfe18512 ("drivers: base: handle module_kobject creation")
Signed-off-by: Sasha Levin <sashal@kernel.org>
include/linux/module.h
kernel/params.c

index a98e188cf37b8182b8654b3be069f93ce1d97174..f2a8624eef1eca8b2e98994455ab15299393558e 100644 (file)
@@ -162,6 +162,8 @@ extern void cleanup_module(void);
 #define __INITRODATA_OR_MODULE __INITRODATA
 #endif /*CONFIG_MODULES*/
 
+struct module_kobject *lookup_or_create_module_kobject(const char *name);
+
 /* Generic info of form tag = "info" */
 #define MODULE_INFO(tag, info) __MODULE_INFO(tag, tag, info)
 
index 8d48a6bfe68da4b7eba1efc69a622aed9c8a17d1..c7aed3c51cd53813ad88112805fccc16fabfbb87 100644 (file)
@@ -759,7 +759,7 @@ void destroy_params(const struct kernel_param *params, unsigned num)
                        params[i].ops->free(params[i].arg);
 }
 
-static struct module_kobject * __init lookup_or_create_module_kobject(const char *name)
+struct module_kobject __modinit * lookup_or_create_module_kobject(const char *name)
 {
        struct module_kobject *mk;
        struct kobject *kobj;