Re: [PATCH] dev_t [2/3]

Andries.Brouwer@cwi.nl
Wed, 19 Mar 2003 01:22:35 +0100 (MET)


This is nice, thanks. We don't have to touch the char drivers now.

Ah, I wish we could change that function to be:
int register_chrdev_region(major, num_minors, name, fops)
if it wasn't for the tty drivers wanting to start their minor at 64.

Hm, wait, why can't we just do it that way and not change the tty core
to use the register_chrdev_region() call? It should still all work
properly, right? The tty core would ask for 256 minors, and split them
off the same way it currently does.

# cat /proc/devices | head
Character devices:
1 mem
2 pty
3 ttyp
4 vc/0
4 vc/%d
4 ttyS%d
5 tty
5 console
5 ptmx
#

The routine tty_register_driver() already finds major, minor_start,
nr_of_minors in its struct tty_driver, so this is the natural,
or at least the easiest, interface to use.

"The tty core would ask for 256 minors" - this doesnt work
very well. One of the problems is that ttyS comes from a
serial module, while vc is virtual console stuff, unrelated.
If opening a device must load the module, then at registration time
we have to tell what minors belong to what module.

Andries
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/