From: Rolf Eike Beer <eike-kernel@sf-tec.de>
To: Jonathan Corbet <corbet@lwn.net>
Cc: Alexey Dobriyan <adobriyan@gmail.com>,
Andrew Morton <akpm@osdl.org>,
linux-kernel@vger.kernel.org
Subject: Re: cdev documentation (was Drop second arg of unregister_chrdev())
Date: Fri, 18 Aug 2006 09:15:28 +0200 [thread overview]
Message-ID: <200608180915.28763.eike-kernel@sf-tec.de> (raw)
In-Reply-To: <20060817212248.19853.qmail@lwn.net>
[-- Attachment #1: Type: text/plain, Size: 1399 bytes --]
Jonathan Corbet wrote:
> Rolf Eike Beer <eike-kernel@sf-tec.de> wrote:
> > > Might this, instead, be an opportunity to get rid of the internal
> > > register_chrdev() and unregister_chrdev() calls in favor of the cdev
> > > interface?
> >
> > In this case I would suggest to add documentation to this functions first
> > to get people the chance to actually know how to use them.
>
> How's the following? Quickly done but, I hope, useful.
>
> I've also put something more tutorial-oriented at:
>
> http://lwn.net/SubscriberLink/195805/b835f36d3b8ee266/
>
> This can be formatted up for the Documentation directory if so desired.
Thanks from the "other developer". What I would like to have is a function
that gives me the next (or even a random) available number from my range.
Currently I have to do it on my own AFAICS.
Nevertheless, I ported my driver to the new interface. I see it cdev_add()
succeeding, but the device never shows up in sysfs. Do I have to do any more
tricks with class devices and stuff?
While I was sneaking around in the code I found this drivers/char/tty_io:3093
cdev_init(&driver->cdev, &tty_fops);
driver->cdev.owner = driver->owner;
error = cdev_add(&driver->cdev, dev, driver->num);
if (error) {
cdev_del(&driver->cdev);
Isn't the call to cdev_del() just wrong here?
Eike
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
next prev parent reply other threads:[~2006-08-18 7:18 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-08-15 3:35 [PATCH] Drop second arg of unregister_chrdev() Alexey Dobriyan
2006-08-15 3:48 ` Andrew Morton
2006-08-15 4:18 ` Alexey Dobriyan
2006-08-15 19:52 ` Jonathan Corbet
2006-08-16 7:03 ` Rolf Eike Beer
2006-08-16 15:42 ` Jonathan Corbet
2006-08-17 21:22 ` cdev documentation (was Drop second arg of unregister_chrdev()) Jonathan Corbet
2006-08-18 7:15 ` Rolf Eike Beer [this message]
2006-08-18 12:32 ` Dmitry Torokhov
2006-08-18 12:46 ` [TTY] Remove bogus call to cdev_del() Rolf Eike Beer
2006-08-18 13:02 ` cdev documentation (was Drop second arg of unregister_chrdev()) Jonathan Corbet
2006-08-18 13:49 ` Dmitry Torokhov
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=200608180915.28763.eike-kernel@sf-tec.de \
--to=eike-kernel@sf-tec.de \
--cc=adobriyan@gmail.com \
--cc=akpm@osdl.org \
--cc=corbet@lwn.net \
--cc=linux-kernel@vger.kernel.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.