Messages in this thread | | | Date | Tue, 23 Nov 2010 23:03:59 +0000 | From | Alan Cox <> | Subject | Re: How do I choose an arbitrary minor number for my tty device? |
| |
> Are you talking about this: > > static struct tty_driver *ehv_bc_console_device(struct console *co, int *index) > { > *index = co->index; > > return ehv_bc_driver; > }
Yes.
> I never really understood this function, but almost everyone does the same > thing, and it seems to work for me. Looking at console_device(), it appears > that all of the xxx_console_device functions are called in order until one of > them returns non-NULL.
*index is the minor number to use - so you can return whichever minor matches your primary interface
> > I suspect in your case you probably want to attach the primary byte > > channel to minor 0 in the driver (and reserve it for that), or some > > similar rule. > > Yes, that's a good idea. It does simplify things a lot.
It's probably the cleanest and simplest solution and it fits the "natural" order of things.
| |