Re: Query regarding alloc_chrdev_region()

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

 



> >> I was wondering that while using dynamic device numner allocation, can
> >> we ever have a scenario like following (using alloc_chrdev_region):
> >>
> >> 1) Char Driver A is hooked on Major num X, minor numbers 0-10
> >> 2) Char Driver B is hooked on (same) Major num X, minor numbers 11-20
>
> So the above is actually possible?

Yes, once you have a major number, you can separate out the minor
numbers how ever you wish to.

Hi Greg,

Ok, I understand that we can get a major number from the kernel and
split it into a range of minor numbers.

But does alloc_chrdev_region() reuse the major numbers in such a way?

In other words, is the following scenario possible:

Driver 1
======
alloc_chrdev_region(10 minor nos required)
-> receives major 150 (minor 0-9)

Driver 2
======
alloc_chrdev_region(20 minor nos required)
-> receives major 150 (minor 10-29)

Thanks,

Rajat

--
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