c.koehne@beckhoff.com has uploaded this change for review. ( 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 --- M em100.c 1 file changed, 2 insertions(+), 2 deletions(-)
git pull ssh://review.coreboot.org:29418/em100 refs/changes/50/80250/1
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; } }