]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
spl: Convert spl_usb_load_image() to use linker list
authorSimon Glass <sjg@chromium.org>
Sun, 25 Sep 2016 00:20:06 +0000 (18:20 -0600)
committerTom Rini <trini@konsulko.com>
Thu, 6 Oct 2016 19:07:29 +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_usb.c
include/spl.h

index 84ae0034db7ed38a611cd08e75abeb12cf8bb333..d2e23bf2d80a0f0660759fb31745c97c3923f7a7 100644 (file)
@@ -400,9 +400,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_USB_SUPPORT
-       case BOOT_DEVICE_USB:
-               return spl_usb_load_image(&bootdev);
 #endif
 #ifdef CONFIG_SPL_SATA_SUPPORT
        case BOOT_DEVICE_SATA:
index f990336a3c4aa78f9f401e702910c4ba8ef9fd20..2bc321ac5bda397f489082b4b01596581d1f5680 100644 (file)
@@ -22,7 +22,7 @@ DECLARE_GLOBAL_DATA_PTR;
 static int usb_stor_curr_dev = -1; /* current device */
 #endif
 
-int spl_usb_load_image(struct spl_boot_device *bootdev)
+static int spl_usb_load_image(struct spl_boot_device *bootdev)
 {
        int err;
        struct blk_desc *stor_dev;
@@ -61,3 +61,4 @@ int spl_usb_load_image(struct spl_boot_device *bootdev)
 
        return 0;
 }
+SPL_LOAD_IMAGE_METHOD(0, BOOT_DEVICE_USB, spl_usb_load_image);
index 78855214f17057bd73fd1036cf4a82baa9f3d209..7270cc21ae7df1c112670f7f0145c4215e04f8ea 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);
 
-/* USB SPL functions */
-int spl_usb_load_image(struct spl_boot_device *bootdev);
-
 /* SATA SPL functions */
 int spl_sata_load_image(struct spl_boot_device *bootdev);