return NULL;
}
-int nand_command_get_device_by_num(struct command_context *cmd_ctx,
- const char *str, struct nand_device **nand)
+COMMAND_HELPER(nand_command_get_device_by_num, unsigned name_index,
+ struct nand_device **nand)
{
+ const char *str = args[name_index];
unsigned num;
COMMAND_PARSE_NUMBER(uint, str, num);
*nand = get_nand_device_by_num(num);
int last = -1;
struct nand_device *p;
- int retval = nand_command_get_device_by_num(cmd_ctx, args[0], &p);
+ int retval = CALL_COMMAND_HANDLER(nand_command_get_device_by_num, 0, &p);
if (ERROR_OK != retval)
return retval;
}
struct nand_device *p;
- int retval = nand_command_get_device_by_num(cmd_ctx, args[0], &p);
+ int retval = CALL_COMMAND_HANDLER(nand_command_get_device_by_num, 0, &p);
if (ERROR_OK != retval)
return retval;
}
struct nand_device *p;
- int retval = nand_command_get_device_by_num(cmd_ctx, args[0], &p);
+ int retval = CALL_COMMAND_HANDLER(nand_command_get_device_by_num, 0, &p);
if (ERROR_OK != retval)
return retval;
}
struct nand_device *p;
- int retval = nand_command_get_device_by_num(cmd_ctx, args[0], &p);
+ int retval = CALL_COMMAND_HANDLER(nand_command_get_device_by_num, 0, &p);
if (ERROR_OK != retval)
return retval;
return ERROR_COMMAND_SYNTAX_ERROR;
struct nand_device *nand;
- int retval = nand_command_get_device_by_num(cmd_ctx, args[0], &nand);
+ int retval = CALL_COMMAND_HANDLER(nand_command_get_device_by_num, 0, &nand);
if (ERROR_OK != retval)
return retval;
}
struct nand_device *p;
- int retval = nand_command_get_device_by_num(cmd_ctx, args[0], &p);
+ int retval = CALL_COMMAND_HANDLER(nand_command_get_device_by_num, 0, &p);
if (ERROR_OK != retval)
return retval;
int nand_init(struct command_context *cmd_ctx);
/// helper for parsing a nand device command argument string
-int nand_command_get_device_by_num(struct command_context *cmd_ctx,
- const char *str, struct nand_device **nand);
+COMMAND_HELPER(nand_command_get_device_by_num, unsigned name_index,
+ struct nand_device **nand);
#define ERROR_NAND_DEVICE_INVALID (-1100)