mirror of
https://review.coreboot.org/flashrom.git
synced 2025-04-28 07:23:43 +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:
parent
d681ab286a
commit
31b283bd21
@ -99,6 +99,7 @@ static const struct par_master par_master_nic3com = {
|
|||||||
.chip_writew = fallback_chip_writew,
|
.chip_writew = fallback_chip_writew,
|
||||||
.chip_writel = fallback_chip_writel,
|
.chip_writel = fallback_chip_writel,
|
||||||
.chip_writen = fallback_chip_writen,
|
.chip_writen = fallback_chip_writen,
|
||||||
|
.shutdown = nic3com_shutdown,
|
||||||
};
|
};
|
||||||
|
|
||||||
static int nic3com_init(void)
|
static int nic3com_init(void)
|
||||||
@ -150,13 +151,7 @@ static int nic3com_init(void)
|
|||||||
|
|
||||||
max_rom_decode.parallel = 128 * 1024;
|
max_rom_decode.parallel = 128 * 1024;
|
||||||
|
|
||||||
if (register_shutdown(nic3com_shutdown, data)) {
|
return register_par_master(&par_master_nic3com, BUS_PARALLEL, data);
|
||||||
free(data);
|
|
||||||
goto init_err_cleanup_exit;
|
|
||||||
}
|
|
||||||
register_par_master(&par_master_nic3com, BUS_PARALLEL, data);
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
init_err_cleanup_exit:
|
init_err_cleanup_exit:
|
||||||
/* 3COM 3C90xB cards need a special fixup. */
|
/* 3COM 3C90xB cards need a special fixup. */
|
||||||
|
10
nicrealtek.c
10
nicrealtek.c
@ -95,6 +95,7 @@ static const struct par_master par_master_nicrealtek = {
|
|||||||
.chip_writew = fallback_chip_writew,
|
.chip_writew = fallback_chip_writew,
|
||||||
.chip_writel = fallback_chip_writel,
|
.chip_writel = fallback_chip_writel,
|
||||||
.chip_writen = fallback_chip_writen,
|
.chip_writen = fallback_chip_writen,
|
||||||
|
.shutdown = nicrealtek_shutdown,
|
||||||
};
|
};
|
||||||
|
|
||||||
static int nicrealtek_init(void)
|
static int nicrealtek_init(void)
|
||||||
@ -138,14 +139,7 @@ static int nicrealtek_init(void)
|
|||||||
data->bios_rom_addr = bios_rom_addr;
|
data->bios_rom_addr = bios_rom_addr;
|
||||||
data->bios_rom_data = bios_rom_data;
|
data->bios_rom_data = bios_rom_data;
|
||||||
|
|
||||||
if (register_shutdown(nicrealtek_shutdown, data)) {
|
return register_par_master(&par_master_nicrealtek, BUS_PARALLEL, data);
|
||||||
free(data);
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
register_par_master(&par_master_nicrealtek, BUS_PARALLEL, data);
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const struct programmer_entry programmer_nicrealtek = {
|
const struct programmer_entry programmer_nicrealtek = {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user