[U-Boot] [PATCH 17/27] spl: Convert spl_sata_load_image() to use linker list
Simon Glass
sjg at chromium.org
Sun Sep 18 21:45:06 CEST 2016
Add a linker list declaration for this method and remove the explicit
switch() code.
Signed-off-by: Simon Glass <sjg at chromium.org>
---
common/spl/spl.c | 4 ----
common/spl/spl_sata.c | 3 ++-
include/spl.h | 3 ---
3 files changed, 2 insertions(+), 8 deletions(-)
diff --git a/common/spl/spl.c b/common/spl/spl.c
index 70cec61..5dd2548 100644
--- a/common/spl/spl.c
+++ b/common/spl/spl.c
@@ -389,10 +389,6 @@ static int spl_load_image(u32 boot_device)
bootdev.boot_device_name = "usb_ether";
return spl_net_load_image(&bootdev);
#endif
-#ifdef CONFIG_SPL_SATA_SUPPORT
- case BOOT_DEVICE_SATA:
- return spl_sata_load_image(&bootdev);
-#endif
#ifdef CONFIG_SPL_BOARD_LOAD_IMAGE
case BOOT_DEVICE_BOARD:
return spl_board_load_image(&bootdev);
diff --git a/common/spl/spl_sata.c b/common/spl/spl_sata.c
index 77fd73c..1a21c05 100644
--- a/common/spl/spl_sata.c
+++ b/common/spl/spl_sata.c
@@ -20,7 +20,7 @@
DECLARE_GLOBAL_DATA_PTR;
-int spl_sata_load_image(struct spl_boot_device *bootdev)
+static int spl_sata_load_image(struct spl_boot_device *bootdev)
{
int err;
struct blk_desc *stor_dev;
@@ -53,3 +53,4 @@ int spl_sata_load_image(struct spl_boot_device *bootdev)
return 0;
}
+SPL_LOAD_IMAGE_METHOD(0, BOOT_DEVICE_SATA, spl_sata_load_image);
diff --git a/include/spl.h b/include/spl.h
index 677e3a1..279896d 100644
--- a/include/spl.h
+++ b/include/spl.h
@@ -187,9 +187,6 @@ int spl_spi_load_image(struct spl_boot_device *bootdev);
/* Ethernet SPL functions */
int spl_net_load_image(struct spl_boot_device *bootdev);
-/* SATA SPL functions */
-int spl_sata_load_image(struct spl_boot_device *bootdev);
-
/* SPL FAT image functions */
int spl_load_image_fat(struct blk_desc *block_dev, int partition,
const char *filename);
--
2.8.0.rc3.226.g39d4020
More information about the U-Boot
mailing list