Nico Huber submitted this change.

View Change

Approvals: build bot (Jenkins): Verified Nico Huber: Looks good to me, approved Angel Pons: Looks good to me, but someone else must approve
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 <th3fanbus@gmail.com>
Signed-off-by: Anastasia Klimchuk <aklm@chromium.org>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/51706
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Nico Huber <nico.h@gmx.de>
---
M dediprog.c
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/dediprog.c b/dediprog.c
index a1d9972..85b78c8 100644
--- a/dediprog.c
+++ b/dediprog.c
@@ -1300,10 +1300,10 @@
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);

To view, visit change 51706. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: Ib7e0179da39279e32a8497466b044b69ec836da8
Gerrit-Change-Number: 51706
Gerrit-PatchSet: 3
Gerrit-Owner: Angel Pons <th3fanbus@gmail.com>
Gerrit-Reviewer: Anastasia Klimchuk <aklm@chromium.org>
Gerrit-Reviewer: Angel Pons <th3fanbus@gmail.com>
Gerrit-Reviewer: Edward O'Callaghan <quasisec@chromium.org>
Gerrit-Reviewer: Nico Huber <nico.h@gmx.de>
Gerrit-Reviewer: build bot (Jenkins) <no-reply@coreboot.org>
Gerrit-CC: Paul Menzel <paulepanter@mailbox.org>
Gerrit-MessageType: merged