int printed;
cfi_flash_bank_t *cfi_info = bank->driver_priv;
- if (cfi_info->qry[0] == -1)
+ if (cfi_info->qry[0] == (char)-1)
{
printed = snprintf(buf, buf_size, "\ncfi flash bank not probed yet\n");
return ERROR_OK;
{
int retval = ERROR_OK;
int old_command_mode;
- char buffer[4096];
+ char *buffer=malloc(4096);
+ if (buffer==NULL)
+ {
+ return ERROR_INVALID_ARGUMENTS;
+ }
old_command_mode = context->mode;
context->mode = mode;
}
context->mode = old_command_mode;
+
+
+ free(buffer);
return retval;
}
if (validate_tries > 5)
{
ERROR("Could not validate JTAG chain, exit");
- exit(-1);
+ jtag = NULL;
+ return ERROR_JTAG_INVALID_INTERFACE;
}
usleep(10000);
}
jtag_reset_config = RESET_TRST_AND_SRST;
else
{
- ERROR("invalid reset_config argument");
- exit(-1);
+ ERROR("invalid reset_config argument, defaulting to none");
+ jtag_reset_config = RESET_NONE;
+ return ERROR_INVALID_ARGUMENTS;
}
}
jtag_reset_config &= ~(RESET_SRST_PULLS_TRST | RESET_TRST_PULLS_SRST);
else
{
- ERROR("invalid reset_config argument");
- exit(-1);
+ ERROR("invalid reset_config argument, defaulting to none");
+ jtag_reset_config = RESET_NONE;
+ return ERROR_INVALID_ARGUMENTS;
}
}
jtag_reset_config &= ~RESET_TRST_OPEN_DRAIN;
else
{
- ERROR("invalid reset_config argument");
- exit(-1);
+ ERROR("invalid reset_config argument, defaulting to none");
+ jtag_reset_config = RESET_NONE;
+ return ERROR_INVALID_ARGUMENTS;
}
}
jtag_reset_config &= ~RESET_SRST_PUSH_PULL;
else
{
- ERROR("invalid reset_config argument");
- exit(-1);
+ ERROR("invalid reset_config argument, defaulting to none");
+ jtag_reset_config = RESET_NONE;
+ return ERROR_INVALID_ARGUMENTS;
}
}