summaryrefslogtreecommitdiffstats
path: root/nicrealtek.c
diff options
context:
space:
mode:
authorAnastasia Klimchuk <aklm@chromium.org>2021-08-27 15:42:46 +1000
committerEdward O'Callaghan <quasisec@chromium.org>2021-08-30 02:43:12 +0000
commit31b283bd21ea1f0e9fc99f2ee17dfce64b3938e2 (patch)
tree1de95f5c7f686b9f2932bbccf6bf9436a5b0d2be /nicrealtek.c
parentd681ab286a8e07900ec62c3e6a2912949dce870f (diff)
downloadflashrom-31b283bd21ea1f0e9fc99f2ee17dfce64b3938e2.tar.gz
flashrom-31b283bd21ea1f0e9fc99f2ee17dfce64b3938e2.tar.bz2
flashrom-31b283bd21ea1f0e9fc99f2ee17dfce64b3938e2.zip
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>
Diffstat (limited to 'nicrealtek.c')
-rw-r--r--nicrealtek.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/nicrealtek.c b/nicrealtek.c
index b8125f410..ec821b4f8 100644
--- a/nicrealtek.c
+++ b/nicrealtek.c
@@ -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 = {