Re: cdev documentation (was Drop second arg of unregister_chrdev())

From: Rolf Eike Beer
Date: Fri Aug 18 2006 - 03:15:46 EST

Jonathan Corbet wrote:
> Rolf Eike Beer <eike-kernel@xxxxxxxxx> 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:
> 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) {

Isn't the call to cdev_del() just wrong here?


Attachment: pgp00000.pgp
Description: PGP signature