Re: How do I choose an arbitrary minor number for my tty device?

From: Michael Ellerman
Date: Wed Nov 24 2010 - 05:23:55 EST


On Thu, 2010-11-18 at 12:13 -0600, Scott Wood wrote:
> On Thu, 18 Nov 2010 11:42:21 -0600
> Timur Tabi <timur@xxxxxxxxxxxxx> wrote:
>
> > Scott Wood wrote:

> > > We should add a proper bus for the "handles" node. Then sysfs should
> > > show the link between the tty device and a device tree node -- which is
> > > really what we're after, the handle is just a means to that end.
> >
> > How exactly do I do that?
>
> Pass the platform device pointer to tty_register_device.
>
> Then, in the sysfs node, "driver" should be a symlink to
> another sysfs node whose path looks lind of like an OF path.
>
> Unfortunately, it's not an exact match, and the fact that reg doesn't
> translate to a physical address means that AFAICT you'll currently get
> something like "byte-channel.nnn", where "nnn" is an arbitrary
> kernel-assigned number.

Can you not use device_rename() ?

> It would be nice if platform devices that are created from device tree
> nodes included a link to the corresponding /proc/device-tree node in
> their sysfs node.

It's not a link, but the OF path is in devspec, so you can work it out
fairly easily.

cheers





Attachment: signature.asc
Description: This is a digitally signed message part