u-boot/common/spl
Nikita Kiryanov fd61d39970 spl: mmc: add break statements in spl_mmc_load_image()
The original intention of the mmc load_image() function was to try multiple
boot modes before failing. This is evident by the lack of break statements
in the switch, and the following line in the default case:
puts("spl: mmc: no boot mode left to try\n");

This implementation is problematic because:
- The availability of alternative boot modes is very arbitrary since it
depends on the specific order of the switch cases. If your boot mode happens to
be the first case, then you'll have a bunch of other boot modes as alternatives.
If it happens to be the last case, then you have none.
- Opting in/out is tied to config options, so the only way for you to prevent an
alternative boot mode from being attempted is to give up on the feature completely.
- This implementation makes the code more complicated and difficult to
understand.

Address these issues by inserting a break statements between the cases to make the
function try only one boot mode.

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>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
2015-11-18 14:49:59 -05:00
..
Makefile spl: Add EXT support to SPL 2014-10-27 17:54:03 -04:00
spl.c malloc_simple: Add support for switching to DRAM heap 2015-10-20 18:40:27 +02:00
spl_ext.c spl: Fix SPL EXT support 2014-11-26 11:21:16 -05:00
spl_fat.c spl: do not hang in spl_register_fat_device but return error value. It allows to use both CONFIG_SPL_FAT_SUPPORT and CONFIG_SPL_EXT_SUPPORT. 2014-10-27 17:54:08 -04:00
spl_mmc.c spl: mmc: add break statements in spl_mmc_load_image() 2015-11-18 14:49:59 -05:00
spl_nand.c spl: nand: remove code duplication 2015-11-18 14:49:34 -05:00
spl_net.c net: cosmetic: Fix checkpatch.pl failures in net.c 2015-04-18 11:11:35 -06:00
spl_nor.c spl, spl_nor: fix compiler warning 2015-02-16 15:48:34 -05:00
spl_onenand.c Add GPL-2.0+ SPDX-License-Identifier to source files 2013-07-24 09:44:38 -04:00
spl_sata.c remove unnecessary version.h includes 2015-03-24 10:50:50 -04:00
spl_usb.c Rename some defines containing FAT in their name to be filesystem generic 2014-10-27 11:04:01 -04:00
spl_ymodem.c Add GPL-2.0+ SPDX-License-Identifier to source files 2013-07-24 09:44:38 -04:00