I have a linux driver that registers a char device for every compatible device-node in the Flattened-Device-Tree(FDT).
On initialization, the driver allocates a major device number and a range of minor device numbers.
when i look at /proc/devices, this major device number is listed.
Now, when I define 2 device-nodes, compatible with that driver, in the FDT, the driver's platform-probe-function get's called twice, and 2 char devices are registered under the same major device number, but with ascending minor device numbers.
Since I can lookup the major number, and I do know how many devices I have and that the minor numbers start at 0, I can just type mknod -m 666 /dev/mydevice1 c 246 0 and mknod -m 666 /dev/mydevice2 c 246 1 to create device nodes for the two char devices.
But I am wondering if there is a way I can lookup all the devices known to the system with their major and minor device numbers, so I do not have to know the minor number beforehand, in order to be able to create device nodes for those devices?