prog_loader: Change legacy_romstage_select_and_load() to return cb_err
This is passing through a cb_err from cbfs_prog_stage_load(), so it should be declared to return that as well. Signed-off-by: Julius Werner <jwerner@chromium.org> Change-Id: I5510d05953fe8c0e2cb511f01f862b66ced154ae Reviewed-on: https://review.coreboot.org/c/coreboot/+/62656 Reviewed-by: Yu-Ping Wu <yupingso@google.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
		@@ -12,7 +12,7 @@ static const char *get_fallback(const char *stagelist)
 | 
			
		||||
	return ++stagelist;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
int legacy_romstage_select_and_load(struct prog *romstage)
 | 
			
		||||
enum cb_err legacy_romstage_select_and_load(struct prog *romstage)
 | 
			
		||||
{
 | 
			
		||||
	static const char *default_filenames = "normal/romstage\0fallback/romstage";
 | 
			
		||||
	const char *boot_candidate;
 | 
			
		||||
@@ -24,8 +24,8 @@ int legacy_romstage_select_and_load(struct prog *romstage)
 | 
			
		||||
 | 
			
		||||
	if (do_normal_boot()) {
 | 
			
		||||
		romstage->name = boot_candidate;
 | 
			
		||||
		if (!cbfs_prog_stage_load(romstage))
 | 
			
		||||
			return 0;
 | 
			
		||||
		if (cbfs_prog_stage_load(romstage) == CB_SUCCESS)
 | 
			
		||||
			return CB_SUCCESS;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	romstage->name = get_fallback(boot_candidate);
 | 
			
		||||
 
 | 
			
		||||
@@ -5,8 +5,7 @@
 | 
			
		||||
#include <bootmem.h>
 | 
			
		||||
#include <commonlib/bsd/cbfs_serialized.h>
 | 
			
		||||
#include <commonlib/region.h>
 | 
			
		||||
#include <stdint.h>
 | 
			
		||||
#include <stddef.h>
 | 
			
		||||
#include <types.h>
 | 
			
		||||
 | 
			
		||||
enum {
 | 
			
		||||
	/* Last segment of program. Can be used to take different actions for
 | 
			
		||||
@@ -139,7 +138,7 @@ void platform_prog_run(struct prog *prog);
 | 
			
		||||
void run_romstage(void);
 | 
			
		||||
 | 
			
		||||
/* Runtime selector for CBFS_PREFIX of romstage. */
 | 
			
		||||
int legacy_romstage_select_and_load(struct prog *romstage);
 | 
			
		||||
enum cb_err legacy_romstage_select_and_load(struct prog *romstage);
 | 
			
		||||
 | 
			
		||||
/************************
 | 
			
		||||
 *   RAMSTAGE LOADING   *
 | 
			
		||||
 
 | 
			
		||||
@@ -27,7 +27,7 @@ void run_romstage(void)
 | 
			
		||||
	timestamp_add_now(TS_COPYROM_START);
 | 
			
		||||
 | 
			
		||||
	if (ENV_X86 && CONFIG(BOOTBLOCK_NORMAL)) {
 | 
			
		||||
		if (legacy_romstage_select_and_load(&romstage))
 | 
			
		||||
		if (legacy_romstage_select_and_load(&romstage) != CB_SUCCESS)
 | 
			
		||||
			goto fail;
 | 
			
		||||
	} else {
 | 
			
		||||
		if (cbfs_prog_stage_load(&romstage))
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user