2021-07-22 06:35:24 +08:00
|
|
|
/*
|
2021-08-08 01:24:59 +08:00
|
|
|
* hello-4.c - Demonstrates module documentation.
|
2021-07-22 06:35:24 +08:00
|
|
|
*/
|
2021-07-22 06:58:13 +08:00
|
|
|
#include <linux/init.h> /* Needed for the macros */
|
2021-08-17 03:02:55 +08:00
|
|
|
#include <linux/kernel.h> /* Needed for pr_info() */
|
2021-07-22 06:58:13 +08:00
|
|
|
#include <linux/module.h> /* Needed by all modules */
|
2021-07-22 06:35:24 +08:00
|
|
|
|
|
|
|
MODULE_LICENSE("GPL");
|
2021-07-22 07:29:07 +08:00
|
|
|
MODULE_AUTHOR("LKMPG");
|
2021-07-22 06:35:24 +08:00
|
|
|
MODULE_DESCRIPTION("A sample driver");
|
|
|
|
|
|
|
|
static int __init init_hello_4(void)
|
|
|
|
{
|
|
|
|
pr_info("Hello, world 4\n");
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void __exit cleanup_hello_4(void)
|
|
|
|
{
|
|
|
|
pr_info("Goodbye, world 4\n");
|
|
|
|
}
|
|
|
|
|
|
|
|
module_init(init_hello_4);
|
|
|
|
module_exit(cleanup_hello_4);
|