summaryrefslogtreecommitdiff
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.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/common/spl/spl_sata.c b/common/spl/spl_sata.c
index 2a5eb29..3ba4c24 100644
--- a/common/spl/spl_sata.c
+++ b/common/spl/spl_sata.c
@@ -14,12 +14,13 @@
#include <asm/u-boot.h>
#include <sata.h>
#include <scsi.h>
+#include <errno.h>
#include <fat.h>
#include <image.h>
DECLARE_GLOBAL_DATA_PTR;
-void spl_sata_load_image(void)
+int spl_sata_load_image(void)
{
int err;
block_dev_desc_t *stor_dev;
@@ -29,11 +30,13 @@ void spl_sata_load_image(void)
#ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
printf("spl: sata init failed: err - %d\n", err);
#endif
- hang();
+ return err;
} else {
/* try to recognize storage devices immediately */
scsi_scan(0);
stor_dev = scsi_get_dev(0);
+ if (!stor_dev)
+ return -ENODEV;
}
#ifdef CONFIG_SPL_OS_BOOT
@@ -45,6 +48,8 @@ void spl_sata_load_image(void)
CONFIG_SPL_FS_LOAD_PAYLOAD_NAME);
if (err) {
puts("Error loading sata device\n");
- hang();
+ return err;
}
+
+ return 0;
}