![]() | |||||||||||||
Messages in this thread |
On Thursday 03 July 2008, Greg KH wrote: > > The scenario is that gpios sometimes get initialized very early, > > as part of board setup before kmalloc or irqs work, so when they > > get registered sometimes there's work left over for later. All > > that's needed is a predicate to test whether that class can be > > used as a parameter to stuff like device_create_drvdata() and > > sysfs_create_group(). > > If you want to see if a class has any devices in it, just do a search > for any device instead of poking into that field. Or I can wrap that up > in the driver core if needed. That would require taking driver model mutexes before tasking is working and driver_init() is called. GPIOs are regularly used *really* early in board setup ... even before IRQs are working. Are driver model searches really expected to work then?? Seems simpler to me to just check "is pointer NULL", when we know that the pointer is initialized by the class initialization, and (because the relevant struct is zero-initialized) null beforehand. That works more or less any point during kernel initialization ... not just after the first task is running. Plus it's not as expensive. :) - Dave -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/ | ||||||||||||
| Last update: 2008-07-12 07:35 [from the cache] ©2003-2008 | |||||||||||||