On Tue, Aug 10, 2010 at 08:56:42AM -0600, Grant Likely wrote: [...] > The suggestion has been raised to use something like bus notifiers to > get a hook onto the device registration before the driver is probed so > that the platform_data can be translated in an separate chuck of code, > but down that path lies insanity. There are all kinds of ordering > issues (like making sure the translation code is called before the > driver probe code), and it is a lot of complexity for what is really a > simple thing.
There's another option: platform data handlers (they could be chained, in case if we want to use several methods of obtaining platform data, i.e. "try raw data, then ACPI, then OF"). See include/linux/spi/mmc_spi.h (mmc_spi_get_pdata) and drivers/mmc/host/of_mmc_spi.c. I think we might implement some library to make these handlers more generic, but even the simple implementation as in mmc_spi case proves that it is possible to separate OF/ACPI/DMI/whatever handling from the generic code. -- Anton Vorontsov email: [email protected] irc://irc.freenode.net/bd2 ------------------------------------------------------------------------------ This SF.net email is sponsored by Make an app they can't live without Enter the BlackBerry Developer Challenge http://p.sf.net/sfu/RIM-dev2dev _______________________________________________ spi-devel-general mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/spi-devel-general
