From: Nikita Kiryanov Date: Sun, 8 Nov 2015 15:11:46 +0000 (+0200) Subject: spl: mmc: get rid of #ifdef CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_PARTITION check X-Git-Tag: v2016.01-rc2~284 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=d074ebb9361f0cd23146ed9e0f443c1b0ab3c249;p=u-boot spl: mmc: get rid of #ifdef CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_PARTITION check Implement defaults for the raw partition image loading so that the #ifdef CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_PARTITION in spl_mmc_load_image() will no longer be necessary. This change makes it possible for mmc_load_image_raw_partition() and mmc_load_image_raw_sector() to coexist. Signed-off-by: Nikita Kiryanov Cc: Igor Grinberg Cc: Paul Kocialkowski Cc: Pantelis Antoniou Cc: Tom Rini Cc: Simon Glass Reviewed-by: Simon Glass Reviewed-by: Tom Rini --- diff --git a/common/spl/spl_mmc.c b/common/spl/spl_mmc.c index 837fa0d930..d646dc8ffa 100644 --- a/common/spl/spl_mmc.c +++ b/common/spl/spl_mmc.c @@ -133,6 +133,12 @@ static int mmc_load_image_raw_partition(struct mmc *mmc, int partition) return mmc_load_image_raw_sector(mmc, info.start); #endif } +#else +#define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_PARTITION -1 +static int mmc_load_image_raw_partition(struct mmc *mmc, int partition) +{ + return -ENOSYS; +} #endif #ifdef CONFIG_SPL_OS_BOOT @@ -193,12 +199,12 @@ void spl_mmc_load_image(void) if (!err) return; } -#if defined(CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_PARTITION) + err = mmc_load_image_raw_partition(mmc, CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_PARTITION); if (!err) return; -#elif defined(CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR) +#if defined(CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR) err = mmc_load_image_raw_sector(mmc, CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR); if (!err) @@ -265,12 +271,11 @@ void spl_mmc_load_image(void) if (!err) return; } -#if defined(CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_PARTITION) err = mmc_load_image_raw_partition(mmc, CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_PARTITION); if (!err) return; -#elif defined(CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR) +#if defined(CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR) err = mmc_load_image_raw_sector(mmc, CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR); if (!err)