mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-18 17:54:13 +08:00
mmc: sdhci: fix an issue of mixing different types
Fix an issue reported by sparse, since mixed types of parameters are used on calling dmaengine_prep_slave_sg(). Fixes: 36e1da441fec (mmc: sdhci: add support for using external DMA devices) Reported-by: kbuild test robot <lkp@intel.com> Signed-off-by: Chunyan Zhang <zhang.chunyan@linaro.org> Reviewed-by: Nathan Chancellor <natechancellor@gmail.com> Acked-by: Adrian Hunter <adrian.hunter@intel.com> Link: https://lore.kernel.org/r/20200120033223.897-1-zhang.chunyan@linaro.org Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
This commit is contained in:
parent
6fac4a3cb0
commit
1215c025e8
@ -1201,6 +1201,7 @@ static int sdhci_external_dma_setup(struct sdhci_host *host,
|
|||||||
struct mmc_command *cmd)
|
struct mmc_command *cmd)
|
||||||
{
|
{
|
||||||
int ret, i;
|
int ret, i;
|
||||||
|
enum dma_transfer_direction dir;
|
||||||
struct dma_async_tx_descriptor *desc;
|
struct dma_async_tx_descriptor *desc;
|
||||||
struct mmc_data *data = cmd->data;
|
struct mmc_data *data = cmd->data;
|
||||||
struct dma_chan *chan;
|
struct dma_chan *chan;
|
||||||
@ -1234,8 +1235,8 @@ static int sdhci_external_dma_setup(struct sdhci_host *host,
|
|||||||
if (sg_cnt <= 0)
|
if (sg_cnt <= 0)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
desc = dmaengine_prep_slave_sg(chan, data->sg, data->sg_len,
|
dir = data->flags & MMC_DATA_WRITE ? DMA_MEM_TO_DEV : DMA_DEV_TO_MEM;
|
||||||
mmc_get_dma_dir(data),
|
desc = dmaengine_prep_slave_sg(chan, data->sg, data->sg_len, dir,
|
||||||
DMA_PREP_INTERRUPT | DMA_CTRL_ACK);
|
DMA_PREP_INTERRUPT | DMA_CTRL_ACK);
|
||||||
if (!desc)
|
if (!desc)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
Loading…
Reference in New Issue
Block a user