[U-Boot] [PATCH V2 03/13] spl: mmc: refactor device location code to its own function

Nikita Kiryanov nikita at compulab.co.il
Sat Oct 31 16:25:18 CET 2015


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 <nikita at compulab.co.il> 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 <nikita at compulab.co.il>
> > Cc: Igor Grinberg <grinberg at compulab.co.il>
> > Cc: Paul Kocialkowski <contact at paulk.fr>
> > Cc: Pantelis Antoniou <panto at antoniou-consulting.com>
> > Cc: Tom Rini <trini at konsulko.com>
> > Cc: Simon Glass <sjg at chromium.org>
> > ---
> > Changes in V2:
> >         - No changes.
> >
> >  common/spl/spl_mmc.c | 77 +++++++++++++++++++++++++++++++++++++---------------
> >  1 file changed, 55 insertions(+), 22 deletions(-)
> 
> Reviewed-by: Simon Glass <sjg at chromium.org>
> 
> 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
> 


More information about the U-Boot mailing list