
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@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@compulab.co.il Cc: Igor Grinberg grinberg@compulab.co.il Cc: Paul Kocialkowski contact@paulk.fr Cc: Pantelis Antoniou panto@antoniou-consulting.com Cc: Tom Rini trini@konsulko.com Cc: Simon Glass sjg@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@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