Minor cleanup of spl_ext and spl_fat files, removing the outdated
CONFIG_SPL_LIBCOMMON_SUPPORT symbols similar to the commit 1847129025e0
("spl: mmc: Drop checks for CONFIG_SPL_LIBCOMMON_SUPPORT") and adding a
few extra failure reports.

Signed-off-by: Anshul Dalal <[email protected]>
---
 common/spl/spl_ext.c |  8 +++-----
 common/spl/spl_fat.c | 14 ++++++--------
 2 files changed, 9 insertions(+), 13 deletions(-)

diff --git a/common/spl/spl_ext.c b/common/spl/spl_ext.c
index 279e254139f..f556986bf5a 100644
--- a/common/spl/spl_ext.c
+++ b/common/spl/spl_ext.c
@@ -47,9 +47,7 @@ int spl_load_image_ext(struct spl_image_info *spl_image,
 
        err = ext4fs_mount();
        if (!err) {
-#ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
                printf("%s: ext4fs mount err - %d\n", __func__, err);
-#endif
                return -1;
        }
 
@@ -63,11 +61,9 @@ int spl_load_image_ext(struct spl_image_info *spl_image,
        err = spl_load(spl_image, bootdev, &load, filelen, 0);
 
 end:
-#ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
        if (err < 0)
                printf("%s: error reading image %s, err - %d\n",
                       __func__, filename, err);
-#endif
 
        return err < 0;
 }
@@ -139,8 +135,10 @@ defaults:
                return err;
 
        err = ext4fs_open(CONFIG_SPL_FS_LOAD_ARGS_NAME, &filelen);
-       if (err < 0)
+       if (err < 0) {
                puts("spl: ext4fs_open failed\n");
+               return err;
+       }
 
        err = ext4fs_read((void *)CONFIG_SPL_PAYLOAD_ARGS_ADDR, 0, filelen, 
&actlen);
        if (err < 0) {
diff --git a/common/spl/spl_fat.c b/common/spl/spl_fat.c
index 2c8eee01272..80e800b4755 100644
--- a/common/spl/spl_fat.c
+++ b/common/spl/spl_fat.c
@@ -98,11 +98,9 @@ int spl_load_image_fat(struct spl_image_info *spl_image,
        err = spl_load(spl_image, bootdev, &load, size, 0);
 
 end:
-#ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
        if (err < 0)
                printf("%s: error reading image %s, err - %d\n",
                       __func__, filename, err);
-#endif
 
        return err;
 }
@@ -116,8 +114,10 @@ int spl_load_image_fat_os(struct spl_image_info *spl_image,
        __maybe_unused char *file;
 
        err = spl_register_fat_device(block_dev, partition);
-       if (err)
+       if (err) {
+               printf("%s: fat mount err - %d\n", __func__, err);
                return err;
+       }
 
        if (!CONFIG_IS_ENABLED(ENV_SUPPORT))
                goto defaults;
@@ -157,11 +157,9 @@ defaults:
        err = file_fat_read(CONFIG_SPL_FS_LOAD_ARGS_NAME,
                            (void *)CONFIG_SPL_PAYLOAD_ARGS_ADDR, 0);
        if (err <= 0) {
-#ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
-               printf("%s: error reading image %s, err - %d\n",
-                      __func__, CONFIG_SPL_FS_LOAD_ARGS_NAME, err);
-#endif
-               return -1;
+               printf("%s: error reading image %s, err - %d\n", __func__,
+                      CONFIG_SPL_FS_LOAD_ARGS_NAME, err);
+               return err;
        }
 
        return 0;
-- 
2.51.0

Reply via email to