lkml.org 
[lkml]   [2010]   [Nov]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
DateTue, 23 Nov 2010 23:03:59 +0000
FromAlan Cox <>
SubjectRe: 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.


\
 
 \ /
  Last update: 2010-11-24 00:07    [from the cache]
©2003-2010