From: Mike Frysinger Date: Wed, 25 Jan 2012 14:10:26 -0500 Subject: [U-Boot] [PATCH V3 4/6] sf command: allow default chip select through CONFIG_SPI_FLASH_CS In-Reply-To: <4F201B5A.4010500@esd.eu> References: <1327421904-21487-1-git-send-email-eric.nelson@boundarydevices.com> <1327421904-21487-5-git-send-email-eric.nelson@boundarydevices.com> <4F201B5A.4010500@esd.eu> Message-ID: <201201251410.29082.vapier@gentoo.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Wednesday 25 January 2012 10:10:18 Matthias Fuchs wrote: > Can you also add a config option for the SPI bus number? I think these > two need to handled in the same patch. > > So you could add this stuff: > > static int do_spi_flash_probe(int argc, char * const argv[]) > { > +#ifdef CONFIG_SF_DEFAULT_BUS > + unsigned int bus = CONFIG_SF_DEFAULT_BUS; > +#else > unsigned int bus = 0; > +#endif move the default logic to the top of the file like the existing CONFIG_SF_DEFAULT_SPEED, then the code later on only needs to do: unsigned int bus = CONFIG_SF_DEFAULT_BUS; otherwise, this suggestion sounds good too -mike -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 836 bytes Desc: This is a digitally signed message part. URL: