flash/nor/stm32f1x: fix minor error messages
authorTomas Vanek <vanekt@fbl.cz>
Sat, 19 Jan 2019 13:58:49 +0000 (14:58 +0100)
committerTomas Vanek <vanekt@fbl.cz>
Mon, 4 Feb 2019 10:26:22 +0000 (10:26 +0000)
Change-Id: I1e9e62979c4629c8ba1d5ae89ca7392259969eb6
Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Reviewed-on: http://openocd.zylin.com/4858
Tested-by: jenkins
Reviewed-by: Christopher Head <chead@zaber.com>
src/flash/nor/stm32f1x.c

index fbd75982836c38b0b1b847bb66530efbdff77bf6..a0144c260e7a134193fa4cf6f816fb377d7c3033 100644 (file)
@@ -443,8 +443,10 @@ static int stm32x_protect(struct flash_bank *bank, int set, int first, int last)
                return retval;
 
        retval = stm32x_erase_options(bank);
-       if (retval != ERROR_OK)
+       if (retval != ERROR_OK) {
+               LOG_ERROR("stm32x failed to erase options");
                return retval;
+       }
 
        for (int i = first; i <= last; i++) {
                if (set)
@@ -1227,12 +1229,12 @@ COMMAND_HANDLER(stm32x_handle_unlock_command)
                return retval;
 
        if (stm32x_erase_options(bank) != ERROR_OK) {
-               command_print(CMD_CTX, "stm32x failed to unlock device");
+               command_print(CMD_CTX, "stm32x failed to erase options");
                return ERROR_OK;
        }
 
        if (stm32x_write_options(bank) != ERROR_OK) {
-               command_print(CMD_CTX, "stm32x failed to lock device");
+               command_print(CMD_CTX, "stm32x failed to unlock device");
                return ERROR_OK;
        }