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

From: Timur Tabi
Date: Thu Nov 18 2010 - 12:42:31 EST


Scott Wood wrote:

> 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.

Which code to create the bus? Are you saying that the driver should call
bus_register()?

>> 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.

Well, ok, but I can change that. If I drop the normal character driver
registration and register the byte channels only as tty devices, then I can make
it probe-able. The reason I don't do it now is because, for a normal character
device, I need to call cdev_init() and cdev_add() after all devices have been
registered, which can't be done in an OF driver since I don't get told when
there are no more probes.

> 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?

> And getting rid of the redundant chardev driver would be a
> simplification...

I agree there, but so far people have been telling me, "just do this!" without
actually telling me how to do "this".


--
Timur Tabi
Linux kernel developer at Freescale

--
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/