rmmod not deleting module from /proc/devices
Hello:
I am writing a simple character device driver (code so far given below). I build the .ko file and insmod it. I can then see that the module is included in /proc/devices. However, after I do an rmmod on the module, the name remains in /proc/devices! Should this happen?
I did some google searching and it seems to me that /proc/devices should no longer show the module. lsmod no longer shows it, and I think I am using the chrdev APIs correctly.
Thanks,
Zack
1 #include <linux/types.h>
2 #include <linux/module.h>
3 #include <linux/init.h>
4 #include <linux/fs.h>
5 MODULE_LICENSE("Dual BSD/GPL");
6
7
8 static int kfa_init(void)
9 {
10 dev_t dev_num;
11 u32 status = 0;
12
13 status = alloc_chrdev_region(&dev_num, 0, 1, "kfa");
14 if (status < 0) {
15 printk("<0> An error occurred allocating dev numbers\n");
16 }
17
18 printk("<0> Hello! kfa_init() called!\n");
19
20 return (0);
21 }
22
23 static void kfa_fini(void)
24 {
25 unregister_chrdev_region(0, 1);
26 printk("<0> kfa_fini called! Exiting....\n");
27 }
28
29 module_init(kfa_init);
30 module_exit(kfa_fini);
|