Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

char: remove unnecessary module_init/exit functions

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>

authored by

Ethan Nelson-Moore and committed by
Greg Kroah-Hartman
16cf2e54 138f2ea9

-30
-16
drivers/char/agp/backend.c
··· 323 323 EXPORT_SYMBOL(agp_off); 324 324 EXPORT_SYMBOL(agp_try_unsupported_boot); 325 325 326 - static int __init agp_init(void) 327 - { 328 - if (!agp_off) 329 - printk(KERN_INFO "Linux agpgart interface v%d.%d\n", 330 - AGPGART_VERSION_MAJOR, AGPGART_VERSION_MINOR); 331 - return 0; 332 - } 333 - 334 - static void __exit agp_exit(void) 335 - { 336 - } 337 - 338 326 #ifndef MODULE 339 327 static __init int agp_setup(char *s) 340 328 { ··· 339 351 MODULE_DESCRIPTION("AGP GART driver"); 340 352 MODULE_LICENSE("GPL and additional rights"); 341 353 MODULE_ALIAS_MISCDEV(AGPGART_MINOR); 342 - 343 - module_init(agp_init); 344 - module_exit(agp_exit); 345 -
-14
drivers/char/nsc_gpio.c
··· 121 121 EXPORT_SYMBOL(nsc_gpio_read); 122 122 EXPORT_SYMBOL(nsc_gpio_dump); 123 123 124 - static int __init nsc_gpio_init(void) 125 - { 126 - printk(KERN_DEBUG NAME " initializing\n"); 127 - return 0; 128 - } 129 - 130 - static void __exit nsc_gpio_cleanup(void) 131 - { 132 - printk(KERN_DEBUG NAME " cleanup\n"); 133 - } 134 - 135 - module_init(nsc_gpio_init); 136 - module_exit(nsc_gpio_cleanup); 137 - 138 124 MODULE_AUTHOR("Jim Cromie <jim.cromie@gmail.com>"); 139 125 MODULE_DESCRIPTION("NatSemi GPIO Common Methods"); 140 126 MODULE_LICENSE("GPL");