From 77e13997d33ce8011f711c2001f82113320511fa Mon Sep 17 00:00:00 2001 From: Aaron Durbin Date: Tue, 29 Nov 2016 17:43:04 -0600 Subject: romstage_handoff: remove code duplication MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The same pattern was being used throughout the code base for initializing the romstage handoff structure. Provide a helper function to initialize the structure with the S3 resume state then utilize it at all the existing call sites. Change-Id: I1e9d588ab6b9ace67757387dbb5963ae31ceb252 Signed-off-by: Aaron Durbin Reviewed-on: https://review.coreboot.org/17646 Tested-by: build bot (Jenkins) Reviewed-by: Kyösti Mälkki Reviewed-by: Furquan Shaikh --- src/soc/intel/fsp_baytrail/romstage/romstage.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'src/soc/intel/fsp_baytrail/romstage/romstage.c') diff --git a/src/soc/intel/fsp_baytrail/romstage/romstage.c b/src/soc/intel/fsp_baytrail/romstage/romstage.c index a7ed414da8..9d204d16e2 100644 --- a/src/soc/intel/fsp_baytrail/romstage/romstage.c +++ b/src/soc/intel/fsp_baytrail/romstage/romstage.c @@ -218,7 +218,6 @@ void romstage_main_continue(EFI_STATUS status, void *hob_list_ptr) int cbmem_was_initted; void *cbmem_hob_ptr; uint32_t prev_sleep_state; - struct romstage_handoff *handoff; timestamp_add_now(TS_AFTER_INITRAM); @@ -257,11 +256,7 @@ void romstage_main_continue(EFI_STATUS status, void *hob_list_ptr) *(u32*)cbmem_hob_ptr = (u32)hob_list_ptr; post_code(0x4e); - handoff = romstage_handoff_find_or_add(); - if (handoff != NULL) - handoff->s3_resume = (prev_sleep_state == ACPI_S3); - else - printk(BIOS_DEBUG, "Romstage handoff structure not added!\n"); + romstage_handoff_init(prev_sleep_state == ACPI_S3); post_code(0x4f); -- cgit v1.2.3