To prepare for handling TCL return values consistently, all calls
to command_print/command_print_sameline should be ready to switch
to CMD as first parameter.
Change prototype of get_current_sam3() to pass CMD instead of
CMD_CTX.
This change was part of http://openocd.zylin.com/1815 from Paul
Fertser and has been extracted and rebased to simplify the review.
Change-Id: Ia1e7af79d0fc89d229b4e10df37317a374bbab62
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/5054
Tested-by: jenkins
static struct sam3_chip *all_sam3_chips;
static struct sam3_chip *all_sam3_chips;
-static struct sam3_chip *get_current_sam3(struct command_context *cmd_ctx)
+static struct sam3_chip *get_current_sam3(struct command_invocation *cmd)
{
struct target *t;
static struct sam3_chip *p;
{
struct target *t;
static struct sam3_chip *p;
- t = get_current_target(cmd_ctx);
+ t = get_current_target(cmd->ctx);
- command_print(cmd_ctx, "No current target?");
+ command_print(cmd->ctx, "No current target?");
if (!p) {
/* this should not happen */
/* the command is not registered until the chip is created? */
if (!p) {
/* this should not happen */
/* the command is not registered until the chip is created? */
- command_print(cmd_ctx, "No SAM3 chips exist?");
+ command_print(cmd->ctx, "No SAM3 chips exist?");
- command_print(cmd_ctx, "Cannot find SAM3 chip?");
+ command_print(cmd->ctx, "Cannot find SAM3 chip?");
COMMAND_HANDLER(sam3_handle_info_command)
{
struct sam3_chip *pChip;
COMMAND_HANDLER(sam3_handle_info_command)
{
struct sam3_chip *pChip;
- pChip = get_current_sam3(CMD_CTX);
+ pChip = get_current_sam3(CMD);
if (!pChip)
return ERROR_OK;
if (!pChip)
return ERROR_OK;
int r, who;
struct sam3_chip *pChip;
int r, who;
struct sam3_chip *pChip;
- pChip = get_current_sam3(CMD_CTX);
+ pChip = get_current_sam3(CMD);
if (!pChip)
return ERROR_OK;
if (!pChip)
return ERROR_OK;
{
struct sam3_chip *pChip;
{
struct sam3_chip *pChip;
- pChip = get_current_sam3(CMD_CTX);
+ pChip = get_current_sam3(CMD);
if (!pChip)
return ERROR_OK;
if (!pChip)
return ERROR_OK;