/** Driver name that is used to select it from configuration files. */
const char *name;
+ /** Usage of flash command registration. */
+ const char *usage;
+
const struct command_registration *commands;
/** NAND device command called when driver is instantiated during configuration. */
if (CMD_ARGC < 2)
{
- LOG_ERROR("missing target");
- return ERROR_COMMAND_ARGUMENT_INVALID;
+ return ERROR_COMMAND_SYNTAX_ERROR;
}
target = get_target(CMD_ARGV[1]);
if (!target) {
retval = CALL_COMMAND_HANDLER(controller->nand_device_command, c);
if (ERROR_OK != retval)
{
- LOG_ERROR("'%s' driver rejected nand flash", controller->name);
+ assert(controller->usage != NULL);
+ LOG_ERROR("'%s' driver rejected nand flash. Usage: %s",
+ controller->name,
+ controller->usage);
free(c);
- return ERROR_OK;
+ return retval;
}
nand_device_add(c);
{
if (CMD_ARGC < 2)
{
- LOG_ERROR("incomplete nand device configuration");
- return ERROR_FLASH_BANK_INVALID;
+ return ERROR_COMMAND_SYNTAX_ERROR;
}
// save name and increment (for compatibility) with drivers
*/
const char *name;
+ /**
+ * Gives a human-readable description of arguments.
+ */
+ const char *usage;
+
/**
* An array of driver-specific commands to register. When called
* during the "flash bank" command, the driver can register addition