]> code.ossystems Code Review - openembedded-core.git/commitdiff
hello-mod/hello.c: convert to module_init/module_exit
authorTrevor Woerner <twoerner@gmail.com>
Wed, 15 Sep 2021 00:38:03 +0000 (20:38 -0400)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 16 Sep 2021 08:48:38 +0000 (09:48 +0100)
Switch away from the old init_module/cleanup_module function names for the
main entry points. Change them to the documented method with module_init()
and module_exit() markers next to static functions.

Signed-off-by: Trevor Woerner <twoerner@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta-skeleton/recipes-kernel/hello-mod/files/hello.c

index f3c0d372ebfc86b91d8c6c3333130c91d79f6417..b68b0c348edef52675dfc53586a169fcdb173437 100644 (file)
 
 #include <linux/module.h>
 
-int init_module(void)
+static int __init hello_init(void)
 {
        printk("Hello World!\n");
        return 0;
 }
 
-void cleanup_module(void)
+static void __exit hello_exit(void)
 {
        printk("Goodbye Cruel World!\n");
 }
 
+module_init(hello_init);
+module_exit(hello_exit);
 MODULE_LICENSE("GPL");