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

index 9be256e3133ffb8e3d4ea22fd1b9afde08600efe..bbf87096a70b4345dabab79b65ea7fae90302b77 100644 (file)
@@ -384,10 +384,6 @@ static int spl_load_image(u32 boot_device)
                return loader->load_image(&bootdev);
 
        switch (boot_device) {
-#ifdef CONFIG_SPL_NAND_SUPPORT
-       case BOOT_DEVICE_NAND:
-               return spl_nand_load_image(&bootdev);
-#endif
 #ifdef CONFIG_SPL_ONENAND_SUPPORT
        case BOOT_DEVICE_ONENAND:
                return spl_onenand_load_image(&bootdev);
index 575de661d39f9806a4b308ca5b0f2e7ebcdc5896..ed758e518ca8adf8d8d29ebdb068c65f79f95698 100644 (file)
@@ -67,7 +67,7 @@ static int spl_nand_load_element(int offset, struct image_header *header)
        }
 }
 
-int spl_nand_load_image(void)
+static int spl_nand_load_image(struct spl_boot_device *bootdev)
 {
        int err;
        struct image_header *header;
@@ -145,3 +145,5 @@ int spl_nand_load_image(void)
        return err;
 }
 #endif
+/* Use priorty 1 so that Ubi can override this */
+SPL_LOAD_IMAGE_METHOD(1, BOOT_DEVICE_NAND, spl_nand_load_image);
index 47c10451fee6bc57a89efefacf9795b2988f0640..927f300f3d12aec9d8c32cfa7c78453c90094f3a 100644 (file)
@@ -181,9 +181,6 @@ struct spl_image_loader {
                .load_image = __method, \
        }
 
-/* NAND SPL functions */
-int spl_nand_load_image(struct spl_boot_device *bootdev);
-
 /* OneNAND SPL functions */
 int spl_onenand_load_image(struct spl_boot_device *bootdev);