I was just reading The Linux Kernel Module Programming Guide and and got stuck on character device drivers example.
Makefiles for previous examples were provided, but no
actually driver gets loaded by the macro MODULE_INIT(my_init); here "my_init" can be the user specified function and MUDULE_EXIT(my_cleanup); here my_exit can be the user specified function . those two macros are missing in the above code.
Makefile: the obj-m += chardev.o is to be replaced with obj-m := chardev.o.
I am also a beginner to LLD. If any mistake is there please let me know.
obj-m += chardev.o
Because the function unregister_chrdev() don't return value. This is a helpful link. http://forum.kernelnewbies.org/read.php?17,1114