From 1e2a5d8d8dc89bf4747a0967f213e17e1ae2a793 Mon Sep 17 00:00:00 2001 From: Angel Pons Date: Mon, 22 Mar 2021 11:28:00 +0100 Subject: dediprog.c: Split up compound conditional and swap two operations register_spi_master now becomes the last operation in init function, which is consistent with other spi masters. In addition, the patch fixes propagation of register_spi_master return values, which is also consistent with other spi masters. TEST=ninja test Change-Id: Ib7e0179da39279e32a8497466b044b69ec836da8 Signed-off-by: Angel Pons Signed-off-by: Anastasia Klimchuk Reviewed-on: https://review.coreboot.org/c/flashrom/+/51706 Tested-by: build bot (Jenkins) Reviewed-by: Nico Huber --- dediprog.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'dediprog.c') diff --git a/dediprog.c b/dediprog.c index a1d9972e3..85b78c860 100644 --- a/dediprog.c +++ b/dediprog.c @@ -1300,10 +1300,10 @@ static int dediprog_init(void) if (protocol(dp_data) >= PROTOCOL_V2) spi_master_dediprog.features |= SPI_MASTER_4BA; - if (register_spi_master(&spi_master_dediprog, dp_data) || dediprog_set_leds(LED_NONE, dp_data)) - return 1; /* shutdown function does cleanup */ + if (dediprog_set_leds(LED_NONE, dp_data)) + goto init_err_cleanup_exit; - return 0; + return register_spi_master(&spi_master_dediprog, dp_data); init_err_cleanup_exit: dediprog_shutdown(dp_data); -- cgit v1.2.3