diff mbox

[U-Boot,v2,09/27] spl: Convert spl_ram_load_image() to use linker list

Message ID 1474762817-23091-10-git-send-email-sjg@chromium.org
State Accepted
Delegated to: Tom Rini
Headers show

Commit Message

Simon Glass Sept. 25, 2016, 12:19 a.m. UTC
Add a linker list declaration for this method and remove the explicit
switch() code.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

Changes in v2: None

 common/spl/spl.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

Comments

Tom Rini Sept. 28, 2016, 1:46 a.m. UTC | #1
On Sat, Sep 24, 2016 at 06:19:59PM -0600, Simon Glass wrote:

> 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>
Tom Rini Oct. 7, 2016, 12:33 a.m. UTC | #2
On Sat, Sep 24, 2016 at 06:19:59PM -0600, Simon Glass wrote:

> 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>

Converted the DFU case as well and applied to u-boot/master, thanks!
diff mbox

Patch

diff --git a/common/spl/spl.c b/common/spl/spl.c
index 4c3784c..2bba423 100644
--- a/common/spl/spl.c
+++ b/common/spl/spl.c
@@ -215,6 +215,7 @@  static int spl_ram_load_image(struct spl_boot_device *bootdev)
 
 	return 0;
 }
+SPL_LOAD_IMAGE_METHOD(0, BOOT_DEVICE_RAM, spl_ram_load_image);
 #endif
 
 int spl_init(void)
@@ -372,10 +373,6 @@  static int spl_load_image(u32 boot_device)
 		return loader->load_image(&bootdev);
 
 	switch (boot_device) {
-#ifdef CONFIG_SPL_RAM_DEVICE
-	case BOOT_DEVICE_RAM:
-		return spl_ram_load_image(&bootdev);
-#endif
 #ifdef CONFIG_SPL_MMC_SUPPORT
 	case BOOT_DEVICE_MMC1:
 	case BOOT_DEVICE_MMC2: