[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20101123230359.3c805e2e@lxorguk.ukuu.org.uk>
Date: Tue, 23 Nov 2010 23:03:59 +0000
From: Alan Cox <alan@...rguk.ukuu.org.uk>
To: Timur Tabi <timur@...escale.com>
Cc: Greg KH <gregkh@...e.de>, Arnd Bergmann <arnd@...db.de>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Scott Wood <scottwood@...escale.com>,
Stuart Yoder <stuart.yoder@...escale.com>
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.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists