}
static inline int mmci_dma_prep_data(struct mmci_host *host,
- struct mmc_data *data)
+ struct mmc_data *data,
+ bool next)
{
struct mmci_dmae_priv *dmae = host->dma_priv;
+ struct mmci_dmae_next *nd = &dmae->next_data;
+ if (next)
+ return __mmci_dma_prep_data(host, data, &nd->chan, &nd->desc);
/* Check if next job is already prepared. */
if (dmae->cur && dmae->desc_current)
return 0;
&dmae->desc_current);
}
-static inline int mmci_dma_prep_next(struct mmci_host *host,
- struct mmc_data *data)
-{
- struct mmci_dmae_priv *dmae = host->dma_priv;
- struct mmci_dmae_next *nd = &dmae->next_data;
-
- return __mmci_dma_prep_data(host, data, &nd->chan, &nd->desc);
-}
-
static int mmci_dma_start_data(struct mmci_host *host, unsigned int datactrl)
{
int ret;
if (!host->use_dma)
return -EINVAL;
- ret = mmci_dma_prep_data(host, host->data);
+ ret = mmci_dma_prep_data(host, host->data, false);
if (ret)
return ret;
if (mmci_validate_data(host, data))
return;
- if (!mmci_dma_prep_next(host, data))
+ if (!mmci_dma_prep_data(host, data, true))
data->host_cookie = ++host->next_cookie < 0 ?
1 : host->next_cookie;
}