]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
char: remove unnecessary module_init/exit functions
authorEthan Nelson-Moore <enelsonmoore@gmail.com>
Sat, 31 Jan 2026 02:00:26 +0000 (18:00 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 2 Apr 2026 15:05:53 +0000 (17:05 +0200)
Two char drivers have unnecessary module_init and module_exit functions
that are empty or just print a message. Remove them. Note that if a
module_init function exists, a module_exit function must also exist;
otherwise, the module cannot be unloaded.

Signed-off-by: Ethan Nelson-Moore <enelsonmoore@gmail.com>
Link: https://patch.msgid.link/20260131020027.45775-1-enelsonmoore@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/char/agp/backend.c
drivers/char/nsc_gpio.c

index 4d920ca534a425e45a820a074e9847f25303d8de..8983addca6959b2ea675e3c27d19e3a19034846b 100644 (file)
@@ -323,18 +323,6 @@ int agp_try_unsupported_boot;
 EXPORT_SYMBOL(agp_off);
 EXPORT_SYMBOL(agp_try_unsupported_boot);
 
-static int __init agp_init(void)
-{
-       if (!agp_off)
-               printk(KERN_INFO "Linux agpgart interface v%d.%d\n",
-                       AGPGART_VERSION_MAJOR, AGPGART_VERSION_MINOR);
-       return 0;
-}
-
-static void __exit agp_exit(void)
-{
-}
-
 #ifndef MODULE
 static __init int agp_setup(char *s)
 {
@@ -351,7 +339,3 @@ MODULE_AUTHOR("Dave Jones, Jeff Hartmann");
 MODULE_DESCRIPTION("AGP GART driver");
 MODULE_LICENSE("GPL and additional rights");
 MODULE_ALIAS_MISCDEV(AGPGART_MINOR);
-
-module_init(agp_init);
-module_exit(agp_exit);
-
index da930c72bc740bdff2167037ca6381b823efebd0..2c9b12b854359c422b78fa917fbcfad1cdb042b3 100644 (file)
@@ -121,20 +121,6 @@ EXPORT_SYMBOL(nsc_gpio_write);
 EXPORT_SYMBOL(nsc_gpio_read);
 EXPORT_SYMBOL(nsc_gpio_dump);
 
-static int __init nsc_gpio_init(void)
-{
-       printk(KERN_DEBUG NAME " initializing\n");
-       return 0;
-}
-
-static void __exit nsc_gpio_cleanup(void)
-{
-       printk(KERN_DEBUG NAME " cleanup\n");
-}
-
-module_init(nsc_gpio_init);
-module_exit(nsc_gpio_cleanup);
-
 MODULE_AUTHOR("Jim Cromie <jim.cromie@gmail.com>");
 MODULE_DESCRIPTION("NatSemi GPIO Common Methods");
 MODULE_LICENSE("GPL");