Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions Chapter02/helloworld-params.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,19 @@ MODULE_PARM_DESC(mystr,"this is my char pointer variable");
MODULE_PARM_DESC(myarr,"this is my array of int");
MODULE_INFO(my_field_name, "What eeasy value");

static int __init hellowolrd_init(void) {
static int __init helloworld_init(void) {
pr_info("Hello world with parameters!\n");
pr_info("The *mystr* parameter: %s\n", mystr);
pr_info("The *myint* parameter: %d\n", myint);
pr_info("The *myarr* parameter: %d, %d, %d\n", myarr[0], myarr[1], myarr[2]);
return 0;
}

static void __exit hellowolrd_exit(void) {
static void __exit helloworld_exit(void) {
pr_info("End of the world\n");
}

module_init(hellowolrd_init);
module_exit(hellowolrd_exit);
module_init(helloworld_init);
module_exit(helloworld_exit);
MODULE_AUTHOR("John Madieu <john.madieu@gmail.com>");
MODULE_LICENSE("GPL");
8 changes: 4 additions & 4 deletions Chapter02/helloworld.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@
#include <linux/module.h>
#include <linux/kernel.h>

static int __init hellowolrd_init(void) {
static int __init helloworld_init(void) {
pr_info("Hello world!\n");
return 0;
}

static void __exit hellowolrd_exit(void) {
static void __exit helloworld_exit(void) {
pr_info("End of the world\n");
}

module_init(hellowolrd_init);
module_exit(hellowolrd_exit);
module_init(helloworld_init);
module_exit(helloworld_exit);
MODULE_AUTHOR("John Madieu <john.madieu@gmail.com>");
MODULE_LICENSE("GPL");
8 changes: 4 additions & 4 deletions Chapter16/gpio/gpio-legacy-module.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ static irqreturn_t btn1_pushed_irq_handler(int irq, void *dev_id)
return IRQ_HANDLED;
}

static int __init hellowolrd_init(void)
static int __init helloworld_init(void)
{
int retval;

Expand Down Expand Up @@ -72,7 +72,7 @@ static int __init hellowolrd_init(void)
return 0;
}

static void __exit hellowolrd_exit(void)
static void __exit helloworld_exit(void)
{
free_irq(irq, NULL);
gpio_free(GPIO_LED_RED);
Expand All @@ -84,7 +84,7 @@ static void __exit hellowolrd_exit(void)
}


module_init(hellowolrd_init);
module_exit(hellowolrd_exit);
module_init(helloworld_init);
module_exit(helloworld_exit);
MODULE_AUTHOR("John Madieu <john.madieu@gmail.com>");
MODULE_LICENSE("GPL");