[spi-devel-general] [PATCH v2 3/6] mtd: m25p80: add support to parse the SPI flash's partitions

Hu Mingkai-B21284 B21284 at freescale.com
Thu Sep 2 04:57:30 EDT 2010



> -----Original Message-----
> From: Anton Vorontsov [mailto:cbouatmailru at gmail.com]
> Sent: Wednesday, August 11, 2010 12:02 AM
> To: Grant Likely
> Cc: Joakim Tjernlund; Gala Kumar-B11780; David Brownell; linux-
> mtd at lists.infradead.org; spi-devel-general at lists.sourceforge.net; 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


More information about the linux-mtd mailing list