1
0
mirror of https://review.coreboot.org/flashrom.git synced 2025-04-27 07:02:34 +02:00

par_master: Use new API to register shutdown function

This allows par masters to register shutdown function in par_master
struct, which means there is no need to call register_shutdown in init
function, since this call is now a part of register_par_master.

As a consequence of using new API, this patch also fixes propagation
of register_par_master() return values.

BUG=b:185191942
TEST=builds and ninja test

Change-Id: Ief7be907f53878b4b6567b52889735e5fff64ead
Signed-off-by: Anastasia Klimchuk <aklm@chromium.org>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/57156
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Nico Huber <nico.h@gmx.de>
This commit is contained in:
Anastasia Klimchuk 2021-08-27 15:42:46 +10:00 committed by Edward O'Callaghan
parent d681ab286a
commit 31b283bd21
2 changed files with 4 additions and 15 deletions

View File

@ -99,6 +99,7 @@ static const struct par_master par_master_nic3com = {
.chip_writew = fallback_chip_writew,
.chip_writel = fallback_chip_writel,
.chip_writen = fallback_chip_writen,
.shutdown = nic3com_shutdown,
};
static int nic3com_init(void)
@ -150,13 +151,7 @@ static int nic3com_init(void)
max_rom_decode.parallel = 128 * 1024;
if (register_shutdown(nic3com_shutdown, data)) {
free(data);
goto init_err_cleanup_exit;
}
register_par_master(&par_master_nic3com, BUS_PARALLEL, data);
return 0;
return register_par_master(&par_master_nic3com, BUS_PARALLEL, data);
init_err_cleanup_exit:
/* 3COM 3C90xB cards need a special fixup. */

View File

@ -95,6 +95,7 @@ static const struct par_master par_master_nicrealtek = {
.chip_writew = fallback_chip_writew,
.chip_writel = fallback_chip_writel,
.chip_writen = fallback_chip_writen,
.shutdown = nicrealtek_shutdown,
};
static int nicrealtek_init(void)
@ -138,14 +139,7 @@ static int nicrealtek_init(void)
data->bios_rom_addr = bios_rom_addr;
data->bios_rom_data = bios_rom_data;
if (register_shutdown(nicrealtek_shutdown, data)) {
free(data);
return 1;
}
register_par_master(&par_master_nicrealtek, BUS_PARALLEL, data);
return 0;
return register_par_master(&par_master_nicrealtek, BUS_PARALLEL, data);
}
const struct programmer_entry programmer_nicrealtek = {