> -----Original Message----- > From: Anton Vorontsov [mailto:[email protected]] > Sent: Wednesday, August 11, 2010 12:02 AM > To: Grant Likely > Cc: Joakim Tjernlund; Gala Kumar-B11780; David Brownell; linux- > [email protected]; [email protected]; Hu Mingkai- > B21284; David Woodhouse > Subject: Re: [spi-devel-general] [PATCH v2 3/6] mtd: m25p80: add support to > parse the SPI flash's partitions > > 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. >
It's also a good suggestion, I'll try it. Thanks, Mingkai ------------------------------------------------------------------------------ This SF.net Dev2Dev email is sponsored by: Show off your parallel programming skills. Enter the Intel(R) Threading Challenge 2010. http://p.sf.net/sfu/intel-thread-sfd _______________________________________________ spi-devel-general mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/spi-devel-general
