mirror of
https://github.com/sysprog21/lkmpg.git
synced 2024-12-24 04:55:14 +08:00
d85944d107
The latter might have been used along with printk() in an earlier version, but pr_info() is getting used consistently so adjust the #include comments accordingly. For the avoidance of doubt, pr_info() actually comes from printk.h, which gets #include'd by kernel.h.
25 lines
533 B
C
25 lines
533 B
C
/*
|
|
* hello-4.c - Demonstrates module documentation.
|
|
*/
|
|
#include <linux/init.h> /* Needed for the macros */
|
|
#include <linux/kernel.h> /* Needed for pr_info() */
|
|
#include <linux/module.h> /* Needed by all modules */
|
|
|
|
MODULE_LICENSE("GPL");
|
|
MODULE_AUTHOR("LKMPG");
|
|
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);
|