From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-bw0-f49.google.com ([209.85.214.49]) by bombadil.infradead.org with esmtp (Exim 4.72 #1 (Red Hat Linux)) id 1OirH7-000748-Ez for linux-mtd@lists.infradead.org; Tue, 10 Aug 2010 16:02:02 +0000 Received: by bwz19 with SMTP id 19so2749402bwz.36 for ; Tue, 10 Aug 2010 09:02:00 -0700 (PDT) Date: Tue, 10 Aug 2010 20:01:57 +0400 From: Anton Vorontsov To: Grant Likely Subject: Re: [spi-devel-general] [PATCH v2 3/6] mtd: m25p80: add support to parse the SPI flash's partitions Message-ID: <20100810160157.GA24553@oksana.dev.rtsoft.ru> References: <796604.30863.qm@web180307.mail.gq1.yahoo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: Cc: Joakim Tjernlund , kumar.gala@freescale.com, David Brownell , linux-mtd@lists.infradead.org, spi-devel-general@lists.sourceforge.net, "linuxppc-dev@ozlabs.org Mingkai Hu" , David Woodhouse List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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: cbouatmailru@gmail.com irc://irc.freenode.net/bd2