Skip to contentSkip to conversation

Plans to obsolete register_chrdev()?

DISCUSSION Michael Opdenacker 1 participant 2 messages Jun 9, 2006 – Jun 12, 2006

lore
Share & tools
lore
#0 lore raw

Hello,

In Linux 2.6, character device driver developers are supposed to use alloc_chrdev_region() and cdev_add() instead of register_chrdev(). See http://lwn.net/images/pdf/LDD3/ch03.pdf or http://lwn.net/Articles/126808/ .

However, in 2.6.16, there are still *very few* uses of cdev_add(). Compare http://lxr.free-electrons.com/ident?i=cdev_add to http://lxr.free-electrons.com/ident?i=register_chrdev .

Are there plans to officially obsolete register_chrdev() (in particular through Documentation/feature-removal-schedule.txt)?

Unless register_chrdev() is supposed to stay, I'll be glad to participate in converting character driver code. In particular, would updateds to drivers/chars/mem.c file be welcome?

Cheers,

Michael.

Signature · 4 lines
Michael Opdenacker, Free Electrons
Free Embedded Linux Training Materials
on http://free-electrons.com/training
(More than 1000 pages!)
#1 lore raw

Hello,

Quoted 7 lines

In Linux 2.6, character device driver developers are supposed to use alloc_chrdev_region() and cdev_add() instead of register_chrdev(). See http://lwn.net/images/pdf/LDD3/ch03.pdf or http://lwn.net/Articles/126808/ .

However, in 2.6.16, there are still *very few* uses of cdev_add(). Compare http://lxr.free-electrons.com/ident?i=cdev_add to http://lxr.free-electrons.com/ident?i=register_chrdev .

Are there plans to officially obsolete register_chrdev() (in particular through Documentation/feature-removal-schedule.txt)?

Unless register_chrdev() is supposed to stay, I'll be glad to participate in converting character driver code. In particular, would updates to the drivers/chars/mem.c file be welcome?

No answer in 3 days... Does anyone know whether register_chrdev is really supposed to go?

If register_chrdev is obsolete, it would be nice to start migrating existing character drivers to alloc_chrdev_region() and cdev_add(), and I will be glad to help.

TIA,

Michael.

Signature · 4 lines
Michael Opdenacker, Free Electrons
Free Embedded Linux Training Materials
on http://free-electrons.com/training
(More than 1000 pages!)