[RFC PATCH 1/2] serial: 8250: Add a notifier chain for driver registration.

Grant Likely grant.likely at secretlab.ca
Fri Mar 18 16:18:44 EST 2011


On Thu, Mar 17, 2011 at 11:48:14PM +0000, Alan Cox wrote:
> > Device registration isn't the problem.  The problem is supplying
> > machine-specific callbacks from the board support code to the
> > drivers.  When devices are sourced from a device tree, it is easy to
> > get data about the device out of the tree, but it is really hard to
> > get callback pointers.  To make it all work without this fiddling
> > about, the octeon serial_{in,out} implementation would need to be
> > rolled into of_serial.c (which FWIW, I have absolutely no problem
> > with).
> 
> Disagree - the arch code needs to register I/O method descriptions with
> the of_serial code they don't neccessarily need to be in it.
> 
> Ie you'd have something like
> 
> 	of_serial8250_register_ops("dt-op-type-name-blah", &ops);
> 
> in the early boot code, and the ops can be in the arch, providing the ops
> has a module owner field the rest can even work modular. Sure the stuff
> should be able to describe standard forms directly without extra methods
> being registered but for the special stuff I think that is the right
> approach

Yeah, okay.  That's nice and clean.  I like it.

> Funnily enough I'm in the middle of trying to rip the rm9k, au and other
> crap out of 8250.c by doing this for the UPIO_xxx ids and once you have
> an ops struct you can also then go and boot out the resource claim crap
> and package it all nicely.

:-)

g.


More information about the devicetree-discuss mailing list