Jonathan Corbet wrote: > Rolf Eike Beer <[email protected]> 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:
pgpI8s5QaLSB0.pgp
Description: PGP signature
- Follow-Ups:
- Re: cdev documentation (was Drop second arg of unregister_chrdev())
- From: [email protected] (Jonathan Corbet)
- Re: cdev documentation (was Drop second arg of unregister_chrdev())
- From: "Dmitry Torokhov" <[email protected]>
- Re: cdev documentation (was Drop second arg of unregister_chrdev())
- References:
- cdev documentation (was Drop second arg of unregister_chrdev())
- From: [email protected] (Jonathan Corbet)
- cdev documentation (was Drop second arg of unregister_chrdev())
- Prev by Date: Re: [PATCH] net: restrict device names from having whitespace
- Next by Date: [PATCH][CHAR] Return better error codes if drivers/char/raw.c module init fails
- Previous by thread: cdev documentation (was Drop second arg of unregister_chrdev())
- Next by thread: Re: cdev documentation (was Drop second arg of unregister_chrdev())
- Index(es):