Avoiding character device major number - is it possible ?

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

 



Hello,

 I want to write a simple device driver that will be controlled by IOCTLs
from user space. These IOCTLs will operate on /dev/myDev file , which will
represent a character device; I know that I can register a char device
by register_chrdev(MY_MAJOR_NUM, "mymodule", &mymodule_fops);The thing is
that this binds me to a specific major number for the device (MY_MAJOR_NUM).
Suppose I will choose an arbitrary number, say 300, for MY_MAJOR_NUM.
Then,if this module will be run on a machine on which this major number is held
by a diffrent driver (from let's say some  different device) , than I will be
unable to work with my driver ; since 300 (MY_MAJOR_NUM)
, which I had chosen as MY_MAJOR_NUM, will be held by a different
driver ,so  register_chrdev() will fail.

Is there a way to avoid using a specific major number and use some dynamic
mechanism which will give me a free char device for /dev/myDev?

Rgs,
Rgs,
Kevin Wilson

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at 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