From: kai@gnukai.com (Kai Meyer)
To: kernelnewbies@lists.kernelnewbies.org
Subject: Trouble removing character device
Date: Wed, 19 Oct 2011 10:04:24 -0600 [thread overview]
Message-ID: <4E9EF508.4000502@gnukai.com> (raw)
In-Reply-To: <1318881863.52041.YahooMailNeo@web30802.mail.mud.yahoo.com>
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
next prev parent reply other threads:[~2011-10-19 16:04 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-10-17 20:04 How can I test if a physical address is already mapped or not StephanT
2011-10-18 5:52 ` Rajat Sharma
2011-10-18 17:23 ` StephanT
2011-10-18 20:47 ` Jeff Haran
2011-10-18 20:58 ` StephanT
2011-10-18 21:16 ` Jeff Haran
2011-10-19 0:28 ` StephanT
2011-10-19 0:46 ` Jeff Haran
2011-10-19 1:01 ` StephanT
2011-10-19 1:16 ` Jeff Haran
2011-10-19 5:48 ` Rajat Sharma
2011-10-19 17:10 ` StephanT
2011-10-19 16:04 ` Kai Meyer [this message]
2011-10-19 20:18 ` Trouble removing character device Daniel Baluta
2011-10-19 20:55 ` Kai Meyer
2011-10-19 21:34 ` Understanding memcpy Kai Meyer
2011-10-20 4:00 ` rohan puri
2011-10-20 15:40 ` Kai Meyer
2011-10-20 3:47 ` Trouble removing character device rohan puri
2011-10-20 15:41 ` Kai Meyer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4E9EF508.4000502@gnukai.com \
--to=kai@gnukai.com \
--cc=kernelnewbies@lists.kernelnewbies.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.