summaryrefslogtreecommitdiffstats
path: root/meta-skeleton/recipes-kernel/hello-mod
diff options
context:
space:
mode:
authorTrevor Woerner <twoerner@gmail.com>2021-09-14 20:38:03 -0400
committerRichard Purdie <richard.purdie@linuxfoundation.org>2021-09-16 09:50:34 +0100
commit6b86c700816c7bc2fbba236b291df19edf2e0ea7 (patch)
treea5b37565c8ccd024e9f0980e683f1ee2e86be5b0 /meta-skeleton/recipes-kernel/hello-mod
parentba7f322a3e9dc2cd3a33bacb865c0e85010734af (diff)
downloadpoky-6b86c700816c7bc2fbba236b291df19edf2e0ea7.tar.gz
hello-mod/hello.c: convert to module_init/module_exit
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. (From OE-Core rev: dd0cf45cdde7a197293322436957566e9a11a506) Signed-off-by: Trevor Woerner <twoerner@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta-skeleton/recipes-kernel/hello-mod')
-rw-r--r--meta-skeleton/recipes-kernel/hello-mod/files/hello.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/meta-skeleton/recipes-kernel/hello-mod/files/hello.c b/meta-skeleton/recipes-kernel/hello-mod/files/hello.c
index f3c0d372eb..b68b0c348e 100644
--- a/meta-skeleton/recipes-kernel/hello-mod/files/hello.c
+++ b/meta-skeleton/recipes-kernel/hello-mod/files/hello.c
@@ -19,15 +19,17 @@
19 19
20#include <linux/module.h> 20#include <linux/module.h>
21 21
22int init_module(void) 22static int __init hello_init(void)
23{ 23{
24 printk("Hello World!\n"); 24 printk("Hello World!\n");
25 return 0; 25 return 0;
26} 26}
27 27
28void cleanup_module(void) 28static void __exit hello_exit(void)
29{ 29{
30 printk("Goodbye Cruel World!\n"); 30 printk("Goodbye Cruel World!\n");
31} 31}
32 32
33module_init(hello_init);
34module_exit(hello_exit);
33MODULE_LICENSE("GPL"); 35MODULE_LICENSE("GPL");