From mboxrd@z Thu Jan 1 00:00:00 1970 From: kai@gnukai.com (Kai Meyer) Date: Wed, 19 Oct 2011 10:04:24 -0600 Subject: Trouble removing character device In-Reply-To: <1318881863.52041.YahooMailNeo@web30802.mail.mud.yahoo.com> References: <1318881863.52041.YahooMailNeo@web30802.mail.mud.yahoo.com> Message-ID: <4E9EF508.4000502@gnukai.com> To: kernelnewbies@lists.kernelnewbies.org List-Id: kernelnewbies.lists.kernelnewbies.org I can't seem to get my character device to remove itself from the /proc/devices list. I'm calling all of the following functions like so: alloc_chrdev_region(&dev, 0, 5, "my_char"); cdev_init(&my_cdev, &my_ops); cdev_add(&my_cdev, MKDEV(my_major, my_minor), 1); cdev_del(&my_cdev); unregister_chrdev_region(my_major, 5); It seems like I'm missing something, but I can't find it. I'm referencing the Linux Device Drivers v3, chapter 3. In the example code, the scull_cleanup_module function calls cdev_dell and unregister_chrdev_region, just like I do. To be clear, after I unload my module (after calling cdev_del and unregister_chrdev_region), my "my_char" string still shows up in /proc/devices. -Kai Meyer