Use COMMAND_HELPER macro to declare flash_command_get_bank_by_num.
This is required for COMMAND_PARSE_NUMBER macro.
}
struct flash_bank *bank;
- int retval = flash_command_get_bank_by_num(cmd_ctx, args[0], &bank);
+ int retval = CALL_COMMAND_HANDLER(flash_command_get_bank_by_num, 0, &bank);
if (ERROR_OK != retval)
return retval;
return p;
}
-int flash_command_get_bank_by_num(
- struct command_context *cmd_ctx, const char *str, struct flash_bank **bank)
+COMMAND_HELPER(flash_command_get_bank_by_num,
+ unsigned name_index, struct flash_bank **bank)
{
unsigned bank_num;
- COMMAND_PARSE_NUMBER(uint, str, bank_num);
+ COMMAND_PARSE_NUMBER(uint, args[name_index], bank_num);
*bank = get_flash_bank_by_num(bank_num);
if (!*bank)
}
struct flash_bank *p;
- int retval = flash_command_get_bank_by_num(cmd_ctx, args[0], &p);
+ int retval = CALL_COMMAND_HANDLER(flash_command_get_bank_by_num, 0, &p);
if (ERROR_OK != retval)
return retval;
return ERROR_COMMAND_SYNTAX_ERROR;
struct flash_bank *p;
- int retval = flash_command_get_bank_by_num(cmd_ctx, args[0], &p);
+ int retval = CALL_COMMAND_HANDLER(flash_command_get_bank_by_num, 0, &p);
if (ERROR_OK != retval)
return retval;
duration_start(&bench);
struct flash_bank *p;
- int retval = flash_command_get_bank_by_num(cmd_ctx, args[0], &p);
+ int retval = CALL_COMMAND_HANDLER(flash_command_get_bank_by_num, 0, &p);
if (ERROR_OK != retval)
return retval;
/**
* Retreives @a bank from a command argument, reporting errors parsing
* the bank identifier or retreiving the specified bank.
- * @param cmd_ctx The command context for reporting errors.
- * @param str The string containing the bank identifier.
+ * @param name_index The index to the string in args containing the
+ * bank identifier.
* @param bank On output, contians a pointer to the bank or NULL.
* @returns ERROR_OK on success, or an error indicating the problem.
*/
-int flash_command_get_bank_by_num(struct command_context *cmd_ctx,
- const char *str, struct flash_bank **bank);
+COMMAND_HELPER(flash_command_get_bank_by_num, unsigned name_index,
+ struct flash_bank **bank);
/**
* Returns the flash bank like get_flash_bank_by_num(), without probing.
* @param num The flash bank number.
}
struct flash_bank *bank;
- int retval = flash_command_get_bank_by_num(cmd_ctx, args[0], &bank);
+ int retval = CALL_COMMAND_HANDLER(flash_command_get_bank_by_num, 0, &bank);
if (ERROR_OK != retval)
return retval;
}
struct flash_bank *bank;
- int retval = flash_command_get_bank_by_num(cmd_ctx, args[0], &bank);
+ int retval = CALL_COMMAND_HANDLER(flash_command_get_bank_by_num, 0, &bank);
if (ERROR_OK != retval)
return retval;
}
struct flash_bank *bank;
- int retval = flash_command_get_bank_by_num(cmd_ctx, args[0], &bank);
+ int retval = CALL_COMMAND_HANDLER(flash_command_get_bank_by_num, 0, &bank);
if (ERROR_OK != retval)
return retval;
}
struct flash_bank *bank;
- int retval = flash_command_get_bank_by_num(cmd_ctx, args[0], &bank);
+ int retval = CALL_COMMAND_HANDLER(flash_command_get_bank_by_num, 0, &bank);
if (ERROR_OK != retval)
return retval;
}
struct flash_bank *bank;
- int retval = flash_command_get_bank_by_num(cmd_ctx, args[0], &bank);
+ int retval = CALL_COMMAND_HANDLER(flash_command_get_bank_by_num, 0, &bank);
if (ERROR_OK != retval)
return retval;
/* Get the bank descriptor */
struct flash_bank *bank;
- int retval = flash_command_get_bank_by_num(cmd_ctx, args[0], &bank);
+ int retval = CALL_COMMAND_HANDLER(flash_command_get_bank_by_num, 0, &bank);
if (ERROR_OK != retval)
return retval;
/* Get the bank descriptor */
struct flash_bank *bank;
- int retval = flash_command_get_bank_by_num(cmd_ctx, args[0], &bank);
+ int retval = CALL_COMMAND_HANDLER(flash_command_get_bank_by_num, 0, &bank);
if (ERROR_OK != retval)
return retval;
}
struct flash_bank *bank;
- int retval = flash_command_get_bank_by_num(cmd_ctx, args[0], &bank);
+ int retval = CALL_COMMAND_HANDLER(flash_command_get_bank_by_num, 0, &bank);
if (ERROR_OK != retval)
return retval;
}
struct flash_bank *bank;
- int retval = flash_command_get_bank_by_num(cmd_ctx, args[0], &bank);
+ int retval = CALL_COMMAND_HANDLER(flash_command_get_bank_by_num, 0, &bank);
if (ERROR_OK != retval)
return retval;
}
struct flash_bank *bank;
- int retval = flash_command_get_bank_by_num(cmd_ctx, args[0], &bank);
+ int retval = CALL_COMMAND_HANDLER(flash_command_get_bank_by_num, 0, &bank);
if (ERROR_OK != retval)
return retval;
COMMAND_PARSE_NUMBER(u32, args[1], value);
struct flash_bank *bank;
- int retval = flash_command_get_bank_by_num(cmd_ctx, args[2], &bank);
+ int retval = CALL_COMMAND_HANDLER(flash_command_get_bank_by_num, 2, &bank);
if (ERROR_OK != retval)
return retval;
}
struct flash_bank *bank;
- int retval = flash_command_get_bank_by_num(cmd_ctx, args[0], &bank);
+ int retval = CALL_COMMAND_HANDLER(flash_command_get_bank_by_num, 0, &bank);
if (ERROR_OK != retval)
return retval;
}
struct flash_bank *bank;
- int retval = flash_command_get_bank_by_num(cmd_ctx, args[0], &bank);
+ int retval = CALL_COMMAND_HANDLER(flash_command_get_bank_by_num, 0, &bank);
if (ERROR_OK != retval)
return retval;
}
struct flash_bank *bank;
- int retval = flash_command_get_bank_by_num(cmd_ctx, args[0], &bank);
+ int retval = CALL_COMMAND_HANDLER(flash_command_get_bank_by_num, 0, &bank);
if (ERROR_OK != retval)
return retval;
}
struct flash_bank *bank;
- int retval = flash_command_get_bank_by_num(cmd_ctx, args[0], &bank);
+ int retval = CALL_COMMAND_HANDLER(flash_command_get_bank_by_num, 0, &bank);
if (ERROR_OK != retval)
return retval;
}
struct flash_bank *bank;
- int retval = flash_command_get_bank_by_num(cmd_ctx, args[0], &bank);
+ int retval = CALL_COMMAND_HANDLER(flash_command_get_bank_by_num, 0, &bank);
if (ERROR_OK != retval)
return retval;
}
struct flash_bank *bank;
- int retval = flash_command_get_bank_by_num(cmd_ctx, args[0], &bank);
+ int retval = CALL_COMMAND_HANDLER(flash_command_get_bank_by_num, 0, &bank);
if (ERROR_OK != retval)
return retval;
}
struct flash_bank *bank;
- int retval = flash_command_get_bank_by_num(cmd_ctx, args[0], &bank);
+ int retval = CALL_COMMAND_HANDLER(flash_command_get_bank_by_num, 0, &bank);
if (ERROR_OK != retval)
return retval;
}
struct flash_bank *bank;
- int retval = flash_command_get_bank_by_num(cmd_ctx, args[0], &bank);
+ int retval = CALL_COMMAND_HANDLER(flash_command_get_bank_by_num, 0, &bank);
if (ERROR_OK != retval)
return retval;
return ERROR_COMMAND_SYNTAX_ERROR;
struct flash_bank *bank;
- int retval = flash_command_get_bank_by_num(cmd_ctx, args[0], &bank);
+ int retval = CALL_COMMAND_HANDLER(flash_command_get_bank_by_num, 0, &bank);
if (ERROR_OK != retval)
return retval;
}
struct flash_bank *bank;
- int retval = flash_command_get_bank_by_num(cmd_ctx, args[0], &bank);
+ int retval = CALL_COMMAND_HANDLER(flash_command_get_bank_by_num, 0, &bank);
if (ERROR_OK != retval)
return retval;
}
struct flash_bank *bank;
- int retval = flash_command_get_bank_by_num(cmd_ctx, args[0], &bank);
+ int retval = CALL_COMMAND_HANDLER(flash_command_get_bank_by_num, 0, &bank);
if (ERROR_OK != retval)
return retval;
}
struct flash_bank *bank;
- int retval = flash_command_get_bank_by_num(cmd_ctx, args[0], &bank);
+ int retval = CALL_COMMAND_HANDLER(flash_command_get_bank_by_num, 0, &bank);
if (ERROR_OK != retval)
return retval;
}
struct flash_bank *bank;
- int retval = flash_command_get_bank_by_num(cmd_ctx, args[0], &bank);
+ int retval = CALL_COMMAND_HANDLER(flash_command_get_bank_by_num, 0, &bank);
if (ERROR_OK != retval)
return retval;
}
struct flash_bank *bank;
- int retval = flash_command_get_bank_by_num(cmd_ctx, args[0], &bank);
+ int retval = CALL_COMMAND_HANDLER(flash_command_get_bank_by_num, 0, &bank);
if (ERROR_OK != retval)
return retval;
}
struct flash_bank *bank;
- int retval = flash_command_get_bank_by_num(cmd_ctx, args[0], &bank);
+ int retval = CALL_COMMAND_HANDLER(flash_command_get_bank_by_num, 0, &bank);
if (ERROR_OK != retval)
return retval;
}
struct flash_bank *bank;
- int retval = flash_command_get_bank_by_num(cmd_ctx, args[0], &bank);
+ int retval = CALL_COMMAND_HANDLER(flash_command_get_bank_by_num, 0, &bank);
if (ERROR_OK != retval)
return retval;
}
struct flash_bank *bank;
- int retval = flash_command_get_bank_by_num(cmd_ctx, args[0], &bank);
+ int retval = CALL_COMMAND_HANDLER(flash_command_get_bank_by_num, 0, &bank);
if (ERROR_OK != retval)
return retval;
}
struct flash_bank *bank;
- int retval = flash_command_get_bank_by_num(cmd_ctx, args[0], &bank);
+ int retval = CALL_COMMAND_HANDLER(flash_command_get_bank_by_num, 0, &bank);
if (ERROR_OK != retval)
return retval;
}
struct flash_bank *bank;
- int retval = flash_command_get_bank_by_num(cmd_ctx, args[0], &bank);
+ int retval = CALL_COMMAND_HANDLER(flash_command_get_bank_by_num, 0, &bank);
if (ERROR_OK != retval)
return retval;