瀏覽代碼

spl: Pass the loader into spl_load_image()

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>
Simon Glass 8 年之前
父節點
當前提交
29d357d7bf
共有 1 個文件被更改,包括 4 次插入4 次删除
  1. 4 4
      common/spl/spl.c

+ 4 - 4
common/spl/spl.c

@@ -367,12 +367,12 @@ static struct spl_image_loader *spl_ll_find_loader(uint boot_device)
 	return NULL;
 	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_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;
 	bootdev.boot_device_name = NULL;
 
 
 	return loader->load_image(spl_image, &bootdev);
 	return loader->load_image(spl_image, &bootdev);
@@ -400,7 +400,7 @@ static int boot_from_devices(struct spl_image_info *spl_image,
 		if (!loader)
 		if (!loader)
 			puts("SPL: Unsupported Boot Device!\n");
 			puts("SPL: Unsupported Boot Device!\n");
 #endif
 #endif
-		if (loader && !spl_load_image(spl_image, spl_boot_list[i]))
+		if (loader && !spl_load_image(spl_image, loader))
 			return 0;
 			return 0;
 	}
 	}