]> git.sur5r.net Git - u-boot/commitdiff
spl: Convert spl_sata_load_image() to use linker list
authorSimon Glass <sjg@chromium.org>
Sun, 25 Sep 2016 00:20:07 +0000 (18:20 -0600)
committerTom Rini <trini@konsulko.com>
Thu, 6 Oct 2016 19:07:33 +0000 (15:07 -0400)
Add a linker list declaration for this method and remove the explicit
switch() code.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
common/spl/spl.c
common/spl/spl_sata.c
include/spl.h

index d2e23bf2d80a0f0660759fb31745c97c3923f7a7..9890a889abd809c830529146ce35968e39c77365 100644 (file)
@@ -401,10 +401,6 @@ static int spl_load_image(u32 boot_device)
                return spl_net_load_image(&bootdev);
 #endif
 #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);
index 77fd73c9893d2df12edc686178d5d295ac389440..1a21c051a10b38c8f08e53142f464cd26c610b36 100644 (file)
@@ -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);
index 7270cc21ae7df1c112670f7f0145c4215e04f8ea..2d0e128712934214a9a6b24b3ba3abfc9a9e141d 100644 (file)
@@ -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);