From mboxrd@z Thu Jan 1 00:00:00 1970 From: Reinhard Meyer Date: Wed, 13 Oct 2010 09:44:52 +0200 Subject: [U-Boot] [PATCH 2/2] sf: ramtron: new spi fram driver In-Reply-To: <1286785742-1772-2-git-send-email-vapier@gentoo.org> References: <1286290600-18988-1-git-send-email-u-boot@emk-elektronik.de> <1286785742-1772-2-git-send-email-vapier@gentoo.org> Message-ID: <4CB56374.7040901@emk-elektronik.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Dear Mike Frysinger, > From: Reinhard Meyer > > Supports most types that support Read-Id and the FM25H20. > > Signed-off-by: Reinhard Meyer > Signed-off-by: Mike Frysinger > --- [snippebedip] > +#ifdef CONFIG_SPI_FRAM_RAMTRON > + { 6, 0xc2, spi_fram_probe_ramtron, }, > +# undef IDCODE_CONT_LEN > +# define IDCODE_CONT_LEN 6 > +#endif That code should only increase the IDCODE_CONT_LEN, not set it to a value. It might have been set larger by a previous #ifdef. +#ifdef CONFIG_SPI_FRAM_RAMTRON + { 6, 0xc2, spi_fram_probe_ramtron, }, +# if IDCODE_CONT_LEN < 6 +# undef IDCODE_CONT_LEN +# define IDCODE_CONT_LEN 6 +# endif +#endif Even "nicer" and maybe better understandable could be: +#ifdef CONFIG_SPI_FRAM_RAMTRON +# define RAMTRON_CONT_LEN 6 + { RAMTRON_CONT_LEN, 0xc2, spi_fram_probe_ramtron, }, +# if IDCODE_CONT_LEN < RAMTRON_CONT_LEN +# undef IDCODE_CONT_LEN +# define IDCODE_CONT_LEN RAMTRON_CONT_LEN +# endif +#endif I cannot test all this right now. Maybe you put just the probing part (1/2) into mainline, once all my local ahead-of-MASTER and posted patches are in mainline, I'll do a big rebase and fix session here and post a new ramtron patch. Reinhard