summaryrefslogtreecommitdiffstats
path: root/common/spl
diff options
context:
space:
mode:
Diffstat (limited to 'common/spl')
-rw-r--r--common/spl/spl_fat.c2
-rw-r--r--common/spl/spl_fit.c7
-rw-r--r--common/spl/spl_mmc.c2
-rw-r--r--common/spl/spl_sata.c2
-rw-r--r--common/spl/spl_usb.c2
5 files changed, 10 insertions, 5 deletions
diff --git a/common/spl/spl_fat.c b/common/spl/spl_fat.c
index 338ea2f092..5b0d96925e 100644
--- a/common/spl/spl_fat.c
+++ b/common/spl/spl_fat.c
@@ -58,7 +58,7 @@ int spl_load_image_fat(struct blk_desc *block_dev,
goto end;
err = spl_parse_image_header(header);
- if (err <= 0)
+ if (err)
goto end;
err = file_fat_read(filename, (u8 *)spl_image.load_addr, 0);
diff --git a/common/spl/spl_fit.c b/common/spl/spl_fit.c
index 1a5c0275a7..26842ba285 100644
--- a/common/spl/spl_fit.c
+++ b/common/spl/spl_fit.c
@@ -39,8 +39,13 @@ static int spl_fit_select_fdt(const void *fdt, int images, int *fdt_offsetp)
node >= 0;
node = fdt_next_subnode(fdt, node)) {
name = fdt_getprop(fdt, node, "description", &len);
- if (!name)
+ if (!name) {
+#ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
+ printf("%s: Missing FDT description in DTB\n",
+ __func__);
+#endif
return -EINVAL;
+ }
if (board_fit_config_name_match(name))
continue;
diff --git a/common/spl/spl_mmc.c b/common/spl/spl_mmc.c
index 360c754050..5676acdde3 100644
--- a/common/spl/spl_mmc.c
+++ b/common/spl/spl_mmc.c
@@ -300,7 +300,7 @@ int spl_mmc_load_image(u32 boot_device)
if (part == 7)
part = 0;
- err = mmc_switch_part(0, part);
+ err = blk_dselect_hwpart(mmc_get_blk_desc(mmc), part);
if (err) {
#ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
puts("spl: mmc partition switch failed\n");
diff --git a/common/spl/spl_sata.c b/common/spl/spl_sata.c
index 1719946ec5..9d8cc7c2dd 100644
--- a/common/spl/spl_sata.c
+++ b/common/spl/spl_sata.c
@@ -34,7 +34,7 @@ int spl_sata_load_image(void)
} else {
/* try to recognize storage devices immediately */
scsi_scan(0);
- stor_dev = scsi_get_dev(0);
+ stor_dev = blk_get_devnum_by_type(IF_TYPE_SCSI, 0);
if (!stor_dev)
return -ENODEV;
}
diff --git a/common/spl/spl_usb.c b/common/spl/spl_usb.c
index c42848e6fc..04fa66758c 100644
--- a/common/spl/spl_usb.c
+++ b/common/spl/spl_usb.c
@@ -39,7 +39,7 @@ int spl_usb_load_image(void)
#ifdef CONFIG_USB_STORAGE
/* try to recognize storage devices immediately */
usb_stor_curr_dev = usb_stor_scan(1);
- stor_dev = usb_stor_get_dev(usb_stor_curr_dev);
+ stor_dev = blk_get_devnum_by_type(IF_TYPE_USB, usb_stor_curr_dev);
if (!stor_dev)
return -ENODEV;
#endif
OpenPOWER on IntegriCloud