From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nikita Kiryanov Date: Sat, 31 Oct 2015 17:25:18 +0200 Subject: [U-Boot] [PATCH V2 03/13] spl: mmc: refactor device location code to its own function In-Reply-To: References: <1446024210-16517-1-git-send-email-nikita@compulab.co.il> <1446024210-16517-4-git-send-email-nikita@compulab.co.il> Message-ID: <20151031152518.GA27702@skynet> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi Simon, On Thu, Oct 29, 2015 at 11:19:16AM -0600, Simon Glass wrote: > Hi Nikita, > > On 28 October 2015 at 03:23, Nikita Kiryanov wrote: > > Simplify spl_mmc_load_image() code by moving the part that finds the mmc device > > into its own function spl_mmc_find_device(), available in two flavors: DM and > > non-DM. > > > > This refactor fixes a bug in which an error in the device location sequence > > does not necessarily aborts the rest of the code. With this refactor, we fail > > the moment there is an error. > > > > Signed-off-by: Nikita Kiryanov > > Cc: Igor Grinberg > > Cc: Paul Kocialkowski > > Cc: Pantelis Antoniou > > Cc: Tom Rini > > Cc: Simon Glass > > --- > > Changes in V2: > > - No changes. > > > > common/spl/spl_mmc.c | 77 +++++++++++++++++++++++++++++++++++++--------------- > > 1 file changed, 55 insertions(+), 22 deletions(-) > > Reviewed-by: Simon Glass > > But can we only have one spl_mmc_find_device() function, with the > #ifdef CONFIG_DM_MMC inside it? I prefer to have as few #ifdefs inside a function as possible. Besides, once driver model becomes ubiquitous we're going to have only one spl_mmc_find_device() anyway. > > -- > > 1.9.1 > > > > Regards, > Simon >