Reputation: 305
I'm failing rmmod lcd_module.ko ERROR: Removing 'lcd_module': Device or resource busy
lssmod give me result: lcd_module [permanent]
how do I cancel this option? I want to load my module more than one time for testing.
thank you on advance.
*if I try to install with modprobe it wont recognize my module.
Upvotes: 4
Views: 4144
Reputation: 33509
Also, you can attempt to force the kernel to remove the module with rmmod -f lcd_module
. Cautionary note: This can cause system failure depending on what kind of resources your module has a hold of and what state its in when you try to force the removal.
Upvotes: 0
Reputation: 87381
You have to implement the module_exit
function in your .c
file, like this:
static void __exit myexit(void) {}
module_exit(myexit);
If you haven't already done so before loading your module with insmod
, then the only way to remove that module is rebooting.
Upvotes: 7