diff mbox

[U-Boot,v2,4/8] spl: Pass the loader into spl_load_image()

Message ID 1480545056-17704-5-git-send-email-sjg@chromium.org
State Accepted
Delegated to: Tom Rini
Headers show

Commit Message

Simon Glass Nov. 30, 2016, 10:30 p.m. UTC
Rather than have this function figure out the correct loader again, pass
it in as a parameter.

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

Changes in v2: None

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

Comments

Tom Rini Dec. 12, 2016, 1:39 p.m. UTC | #1
On Wed, Nov 30, 2016 at 03:30:52PM -0700, Simon Glass wrote:

> Rather than have this function figure out the correct loader again, pass
> it in as a parameter.
> 
> Signed-off-by: Simon Glass <sjg@chromium.org>

Applied to u-boot/master, thanks!
diff mbox

Patch

diff --git a/common/spl/spl.c b/common/spl/spl.c
index f97d5b4..062b6cf 100644
--- a/common/spl/spl.c
+++ b/common/spl/spl.c
@@ -367,12 +367,12 @@  static struct spl_image_loader *spl_ll_find_loader(uint boot_device)
 	return NULL;
 }
 
-static int spl_load_image(struct spl_image_info *spl_image, u32 boot_device)
+static int spl_load_image(struct spl_image_info *spl_image,
+			  struct spl_image_loader *loader)
 {
 	struct spl_boot_device bootdev;
-	struct spl_image_loader *loader = spl_ll_find_loader(boot_device);
 
-	bootdev.boot_device = boot_device;
+	bootdev.boot_device = loader->boot_device;
 	bootdev.boot_device_name = NULL;
 
 	return loader->load_image(spl_image, &bootdev);
@@ -400,7 +400,7 @@  static int boot_from_devices(struct spl_image_info *spl_image,
 		if (!loader)
 			puts("SPL: Unsupported Boot Device!\n");
 #endif
-		if (loader && !spl_load_image(spl_image, spl_boot_list[i]))
+		if (loader && !spl_load_image(spl_image, loader))
 			return 0;
 	}