From 31b283bd21ea1f0e9fc99f2ee17dfce64b3938e2 Mon Sep 17 00:00:00 2001 From: Anastasia Klimchuk Date: Fri, 27 Aug 2021 15:42:46 +1000 Subject: 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 Reviewed-on: https://review.coreboot.org/c/flashrom/+/57156 Tested-by: build bot (Jenkins) Reviewed-by: Nico Huber --- nic3com.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'nic3com.c') diff --git a/nic3com.c b/nic3com.c index dd3d0cb1..2af0a52d 100644 --- a/nic3com.c +++ b/nic3com.c @@ -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. */ -- cgit v1.2.3