]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
spl: mmc: Drop checks for CONFIG_SPL_LIBCOMMON_SUPPORT
authorSimon Glass <sjg@chromium.org>
Thu, 22 Aug 2024 13:54:57 +0000 (07:54 -0600)
committerTom Rini <trini@konsulko.com>
Fri, 23 Aug 2024 21:58:41 +0000 (15:58 -0600)
This check is not needed now, since printf() resolved to nothing if not
available. Drop the #ifdefs

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Quentin Schulz <quentin.schulz@cherry.de>
common/spl/spl_mmc.c

index ccab0be4be23d4d5ab83bc72fc7e2828e0c3b4d7..ddc85aaeda72c9112873d6f015685a1d461fa2cc 100644 (file)
@@ -51,9 +51,7 @@ int mmc_load_image_raw_sector(struct spl_image_info *spl_image,
        load.read = h_spl_load_read;
        ret = spl_load(spl_image, bootdev, &load, 0, sector << bd->log2blksz);
        if (ret) {
-#ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
                puts("mmc_load_image_raw_sector: mmc block read error\n");
-#endif
                return -1;
        }
 
@@ -70,9 +68,7 @@ static int spl_mmc_get_device_index(u32 boot_device)
                return 1;
        }
 
-#ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
        printf("spl: unsupported mmc boot device.\n");
-#endif
 
        return -ENODEV;
 }
@@ -91,18 +87,14 @@ static int spl_mmc_find_device(struct mmc **mmcp, u32 boot_device)
        err = mmc_initialize(NULL);
 #endif /* DM_MMC */
        if (err) {
-#ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
                printf("spl: could not initialize mmc. error: %d\n", err);
-#endif
                return err;
        }
        *mmcp = find_mmc_device(mmc_dev);
        err = *mmcp ? 0 : -ENODEV;
        if (err) {
-#ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
                printf("spl: could not find mmc device %d. error: %d\n",
                       mmc_dev, err);
-#endif
                return err;
        }
 
@@ -135,10 +127,8 @@ static int mmc_load_image_raw_partition(struct spl_image_info *spl_image,
 
        err = part_get_info(mmc_get_blk_desc(mmc), partition, &info);
        if (err) {
-#ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
                puts("spl: partition error\n");
-#endif
-               return -1;
+               return -err;
        }
 
 #ifdef CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_SECTOR
@@ -164,9 +154,7 @@ static int mmc_load_image_raw_os(struct spl_image_info *spl_image,
                CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTORS,
                (void *)CONFIG_SPL_PAYLOAD_ARGS_ADDR);
        if (count != CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTORS) {
-#ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
                puts("mmc_load_image_raw_os: mmc block read error\n");
-#endif
                return -1;
        }
 #endif /* CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTOR */
@@ -368,9 +356,7 @@ int spl_mmc_load(struct spl_image_info *spl_image,
                err = mmc_init(mmc);
                if (err) {
                        mmc = NULL;
-#ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
                        printf("spl: mmc init failed with error: %d\n", err);
-#endif
                        return err;
                }
        }
@@ -387,9 +373,7 @@ int spl_mmc_load(struct spl_image_info *spl_image,
                        err = blk_dselect_hwpart(mmc_get_blk_desc(mmc), part);
 
                if (err) {
-#ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
                        puts("spl: mmc partition switch failed\n");
-#endif
                        return err;
                }
                /* Fall through */
@@ -428,10 +412,8 @@ int spl_mmc_load(struct spl_image_info *spl_image,
 
                break;
 #endif
-#ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
        default:
                puts("spl: mmc: wrong boot mode\n");
-#endif
        }
 
        return err;