aboutsummaryrefslogtreecommitdiff
path: root/common/spl/spl_sata.c
diff options
context:
space:
mode:
Diffstat (limited to 'common/spl/spl_sata.c')
-rw-r--r--common/spl/spl_sata.c25
1 files changed, 9 insertions, 16 deletions
diff --git a/common/spl/spl_sata.c b/common/spl/spl_sata.c
index 12397f0ae1..32746ce9f3 100644
--- a/common/spl/spl_sata.c
+++ b/common/spl/spl_sata.c
@@ -17,11 +17,6 @@
#include <fat.h>
#include <image.h>
-#ifndef CONFIG_SPL_SATA_RAW_U_BOOT_SECTOR
-/* Dummy value to make the compiler happy */
-#define CONFIG_SPL_SATA_RAW_U_BOOT_SECTOR 0x100
-#endif
-
static int spl_sata_load_image_raw(struct spl_image_info *spl_image,
struct spl_boot_device *bootdev,
struct blk_desc *stor_dev, unsigned long sector)
@@ -62,7 +57,7 @@ static int spl_sata_load_image_raw(struct spl_image_info *spl_image,
static int spl_sata_load_image(struct spl_image_info *spl_image,
struct spl_boot_device *bootdev)
{
- int err = 0;
+ int err = -ENOSYS;
struct blk_desc *stor_dev;
/* try to recognize storage devices immediately */
@@ -77,16 +72,14 @@ static int spl_sata_load_image(struct spl_image_info *spl_image,
CONFIG_SYS_SATA_FAT_BOOT_PARTITION))
#endif
{
- err = -ENOSYS;
-
- if (IS_ENABLED(CONFIG_SPL_FS_FAT)) {
- err = spl_load_image_fat(spl_image, bootdev, stor_dev,
- CONFIG_SYS_SATA_FAT_BOOT_PARTITION,
- CONFIG_SPL_FS_LOAD_PAYLOAD_NAME);
- } else if (IS_ENABLED(CONFIG_SPL_SATA_RAW_U_BOOT_USE_SECTOR)) {
- err = spl_sata_load_image_raw(spl_image, bootdev, stor_dev,
- CONFIG_SPL_SATA_RAW_U_BOOT_SECTOR);
- }
+#ifdef CONFIG_SPL_FS_FAT
+ err = spl_load_image_fat(spl_image, bootdev, stor_dev,
+ CONFIG_SYS_SATA_FAT_BOOT_PARTITION,
+ CONFIG_SPL_FS_LOAD_PAYLOAD_NAME);
+#elif defined(CONFIG_SPL_SATA_RAW_U_BOOT_USE_SECTOR)
+ err = spl_sata_load_image_raw(spl_image, bootdev, stor_dev,
+ CONFIG_SPL_SATA_RAW_U_BOOT_SECTOR);
+#endif
}
if (err) {
puts("Error loading sata device\n");