diff options
author | Trevor Woerner <twoerner@gmail.com> | 2021-09-14 20:38:03 -0400 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2021-09-16 09:50:34 +0100 |
commit | 6b86c700816c7bc2fbba236b291df19edf2e0ea7 (patch) | |
tree | a5b37565c8ccd024e9f0980e683f1ee2e86be5b0 /meta-skeleton/recipes-kernel/hello-mod/files | |
parent | ba7f322a3e9dc2cd3a33bacb865c0e85010734af (diff) | |
download | poky-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/files')
-rw-r--r-- | meta-skeleton/recipes-kernel/hello-mod/files/hello.c | 6 |
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 | ||
22 | int init_module(void) | 22 | static 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 | ||
28 | void cleanup_module(void) | 28 | static void __exit hello_exit(void) |
29 | { | 29 | { |
30 | printk("Goodbye Cruel World!\n"); | 30 | printk("Goodbye Cruel World!\n"); |
31 | } | 31 | } |
32 | 32 | ||
33 | module_init(hello_init); | ||
34 | module_exit(hello_exit); | ||
33 | MODULE_LICENSE("GPL"); | 35 | MODULE_LICENSE("GPL"); |