On 10/2/07, Benjamin Herrenschmidt <[EMAIL PROTECTED]> wrote: > > On Tue, 2007-10-02 at 22:18 -0600, Grant Likely wrote: > > > For many drivers, I think that is already the case. USB OHCI is a > > prime example where there are both PCI and platform_bus bindings among > > others. It seems to me that the bus binding effectively translates > > down to "where do I go to get the needed information". I think it > > results in less of a maintenance burden to explicitly separate bus > > binding from device setup as opposed to adding constructor code. > > I think nobody consider the mess that is USB in that are to be something > we want to reproduce.
Heh, true, but the structure of multiple bus bindings is probably not something we can get away from. > > > > The important thing however, with the constructor approach is to try as > > > much as possible to keep the proper tree structure, and thus, try to > > > find a way to instanciate the devices with proper parent/child > > > relationship so that ordering for things like suspend/resume operations > > > is maintained. > > > > I'm not sure I follow. Example? > > Well, make sure that if 2 platform devices repreesnt respectively a bus > and a device on that bus, they properly get instanciated as parent & > child in sysfs as well. Right, okay. Looking at platform_device_add(), the default parent is platform_bus, but it can be overridden. of_platform_bus devices get the hierarchy of the device tree by default. So in the platform bus case, the constructor would need to explicitly set the parent device? Correct? Also, how do you see the constructor code getting executed? Called explicitly from the platform code, or some form of auto binding? I look at fsl_soc.c and I shudder as each constructor does a pass of the whole tree looking for compatible nodes. Cheers, g. -- Grant Likely, B.Sc., P.Eng. Secret Lab Technologies Ltd. [EMAIL PROTECTED] (403) 399-0195 _______________________________________________ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev