Module Init And Cleanup Functions Back to module writing, we'll add two functions to our module. One that is invoked after the module is created, and one that is invoked before the module is destroyed. This will be a "less empty module": #include /* defines 'printk' */ #include /* resolves kernel module */ /* versioning issues. */ #ifdef MODULE int init_module(void) { printk("empty_module: initializing\n"); return 0; } void cleanup_module(void) { printk("empty_module: cleaning up\n"); } #endif