/* Host calls this function from idle state (*mrq == NULL) or after finishing previous request (*mrq should point to it). If previous request was unsuccessful, it is retried for predetermined number of times. Return value of 0 means that new request was assigned to the host.  */
int memstick_next_req(struct memstick_host *host, struct memstick_request **mrq)
/* Host calls this function from idle state (*mrq == NULL) or after finishing previous request (*mrq should point to it). If previous request was unsuccessful, it is retried for predetermined number of times. Return value of 0 means that new request was assigned to the host.  */
int memstick_next_req(struct memstick_host *host, struct memstick_request **mrq)
{
	int rc = -ENXIO;
	if ((*mrq) && (*mrq)->error && host->retries) {
		(*mrq)->error = rc;
		host->retries--;
		return 0;
	}
	if (host->card && host->card->next_request)
		rc = host->card->next_request(host->card, mrq);
	if (!rc)
		host->retries = cmd_retries > 1 ? cmd_retries - 1 : 1;
	else
		*mrq = NULL;
	return rc;
}