[U-Boot] [PATCH 2/9] spl: sata: fix build with DM_SCSI

Baruch Siach baruch at tkos.co.il
Thu May 16 10:03:54 UTC 2019


The init_sata() routine is only present when DM_SCSI is not enabled.
Don't call init_sata() when DM_SCSI is enabled. The code will fall back
to scsi_scan() in this case.

Signed-off-by: Baruch Siach <baruch at tkos.co.il>
---
 common/spl/spl_sata.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/common/spl/spl_sata.c b/common/spl/spl_sata.c
index b08efc841903..2fb46108a512 100644
--- a/common/spl/spl_sata.c
+++ b/common/spl/spl_sata.c
@@ -28,10 +28,12 @@
 static int spl_sata_load_image(struct spl_image_info *spl_image,
 			       struct spl_boot_device *bootdev)
 {
-	int err;
+	int err = 0;
 	struct blk_desc *stor_dev;
 
+#if !defined(CONFIG_DM_SCSI) && !defined(CONFIG_AHCI)
 	err = init_sata(CONFIG_SPL_SATA_BOOT_DEVICE);
+#endif
 	if (err) {
 #ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
 		printf("spl: sata init failed: err - %d\n", err);
-- 
2.20.1



More information about the U-Boot mailing list