1
0
mirror of https://review.coreboot.org/flashrom.git synced 2025-07-01 06:01:16 +02:00

internal: Move laptop_ok into board_cfg

Due to how internal is structured around chipset_flash_enable()
entry we need to prepare a crafted programmer_cfg that contains
a board_enable substructure with data derived from the board_enable
subsystem. While this is certainly not perfection, it does make
clear the relationships between board_enable into chipset_flash_enable
and subsequently the overall internal programmer initialisation
in a RAII fashion at the type level over closure upon global
state that is impossible to reason about.

Also flip predicate in report_nonwl_laptop_detected() and
return early with the trivial base-case.

TEST=`$ sudo ./flashrom -p internal --flash-name`.

Change-Id: I459215253845c2af73262943ce91a36464e9eb06
Signed-off-by: Edward O'Callaghan <quasisec@google.com>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/73456
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Sam McNally <sammc@google.com>
This commit is contained in:
Edward O'Callaghan
2023-03-06 11:25:52 +11:00
committed by Edward O'Callaghan
parent 3ed016f08f
commit 67b5526d5c
5 changed files with 45 additions and 44 deletions

View File

@ -65,10 +65,6 @@ static struct shutdown_func_data {
*/
static bool may_register_shutdown = false;
struct programmer_cfg {
char *params;
};
/* Register a function to be executed on programmer shutdown.
* The advantage over atexit() is that you can supply a void pointer which will
* be used as parameter to the registered function upon programmer shutdown.