Re: How do I choose an arbitrary minor number for my tty device?
From: Scott Wood
Date: Thu Nov 18 2010 - 12:23:12 EST
On Thu, 18 Nov 2010 10:03:12 -0600
Timur Tabi <timur@xxxxxxxxxxxxx> wrote:
> I'm not so sure. Like I said, I still don't see where there's a bus. I have a
> single driver that has multiple devices. It sounds to me like one call to
> tty_register_driver() and multiple calls to tty_register_device() would be
> sufficient.
>
> For instance, there is no code in drivers/char/ that makes a call to
> bus_register(), so I don't see any precedent for a tty driver to register a bus
> first.
The tty driver doesn't register the bus, but rather a driver for
some type of device on that bus. The code to create the bus goes
elsewhere, and would not be specific to byte channels.
> Also, this is an Open Firmware driver. I already have a mechanism whereby I get
> probed for each instance of a byte channel. Isn't that my "bus"?
It would be if you actually had it -- but it looks like you just loop
over the nodes.
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.
> I'm really trying to do the right thing here, Greg, but every time I try to
> solve one problem, I'm being told that I need to make things way more
> complicated first.
s/make things way more complicated/use the existing infrastructure
rather than reinvent the wheel/
And getting rid of the redundant chardev driver would be a
simplification...
-Scott
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/