/* Return: Executed command, or -1 if not recognized  */
int fastboot_handle_command(char *cmd_string, char *response)
/* Return: Executed command, or -1 if not recognized  */
int fastboot_handle_command(char *cmd_string, char *response)
{
	int i;
	char *cmd_parameter;
	cmd_parameter = cmd_string;
	strsep(&cmd_parameter, ":");
	for (i = 0; i < FASTBOOT_COMMAND_COUNT; i++) {
		if (!strcmp(commands[i].command, cmd_string)) {
			if (commands[i].dispatch) {
				commands[i].dispatch(cmd_parameter,
							response);
				return i;
			} else {
				break;
			}
		}
	}
	pr_err("command %s not recognized.\n", cmd_string);
	fastboot_fail("unrecognized command", response);
	return -1;
}