Stefan Reinauer has submitted this change. ( https://review.coreboot.org/c/em100/+/80250?usp=email )
Change subject: em100: return an error if a command fails ......................................................................
em100: return an error if a command fails
We don't properly return an error in every code path when a command fails. This makes it hard to use this tool in a shell script because you can't be sure that your command was successful.
Change-Id: I2554252d007a92e939088389d67f9d4cede837ee Signed-off-by: Corvin Köhne c.koehne@beckhoff.com Reviewed-on: https://review.coreboot.org/c/em100/+/80250 Tested-by: build bot (Jenkins) no-reply@coreboot.org Reviewed-by: Stefan Reinauer stefan.reinauer@coreboot.org Reviewed-by: Jakub Czapiga czapiga@google.com --- M em100.c 1 file changed, 2 insertions(+), 2 deletions(-)
Approvals: Jakub Czapiga: Looks good to me, approved build bot (Jenkins): Verified Stefan Reinauer: Looks good to me, approved
diff --git a/em100.c b/em100.c index 666cef9..68407c3 100644 --- a/em100.c +++ b/em100.c @@ -1068,7 +1068,7 @@ if (!set_chip_type(em100, chip)) { printf("Failed configuring chip type.\n"); em100_detach(em100); - return 0; + return 1; } printf("Chip set to %s %s.\n", chip->vendor, chip->name);
@@ -1099,7 +1099,7 @@ if (!set_hold_pin_state_from_str(em100, holdpin)) { printf("Failed configuring hold pin state.\n"); em100_detach(em100); - return 0; + return 1; } }