alloc_chrdev_region creates extra major numbers

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi.


My question is: is it OK to the minor numbers to expand
to the next major number when the major number is dynamic?


This call:

   ret_val = alloc_chrdev_region(&dev, 0, 4, "fullex");

works as expected.


$ cat /proc/devices
Character devices:
251 fullex
252 fullex
253 fullex
254 fullex

 major = MAJOR(dev);

If major is  251, I do:

mknod /dev/fullex0 c 251 0
mknod /dev/fullex1 c 251 1
mknod /dev/fullex2 c 251 2
mknod /dev/fullex3 c 251 3

And all devices work as expected (I made a test with private data
for each device and all /dev/fullex* are different).

Source code:

https://svn.arhuaco.org/svn/src/linux/examples/modules/full/fullex.c

(I'm convertin this file to the 2.6 char device way, it's an example
and I need to use spanish in the comments)

Regards.

--
http://arhuaco.org/

--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux