Commit 2b26e34e authored by Yoshihiro Shimoda's avatar Yoshihiro Shimoda Committed by Ulf Hansson

mmc: renesas_sdhi_internal_dmac: clean up the code for dma complete

To add end() operation in the future, clean the code of
renesas_sdhi_internal_dmac_complete_tasklet_fn(). No behavior change.
Signed-off-by: default avatarYoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Link: https://lore.kernel.org/r/1590044466-28372-3-git-send-email-yoshihiro.shimoda.uh@renesas.comTested-by: default avatarWolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
parent 6dca9a9c
...@@ -229,15 +229,12 @@ static void renesas_sdhi_internal_dmac_issue_tasklet_fn(unsigned long arg) ...@@ -229,15 +229,12 @@ static void renesas_sdhi_internal_dmac_issue_tasklet_fn(unsigned long arg)
DTRAN_CTRL_DM_START); DTRAN_CTRL_DM_START);
} }
static void renesas_sdhi_internal_dmac_complete_tasklet_fn(unsigned long arg) static bool renesas_sdhi_internal_dmac_complete(struct tmio_mmc_host *host)
{ {
struct tmio_mmc_host *host = (struct tmio_mmc_host *)arg;
enum dma_data_direction dir; enum dma_data_direction dir;
spin_lock_irq(&host->lock);
if (!host->data) if (!host->data)
goto out; return false;
if (host->data->flags & MMC_DATA_READ) if (host->data->flags & MMC_DATA_READ)
dir = DMA_FROM_DEVICE; dir = DMA_FROM_DEVICE;
...@@ -250,6 +247,17 @@ static void renesas_sdhi_internal_dmac_complete_tasklet_fn(unsigned long arg) ...@@ -250,6 +247,17 @@ static void renesas_sdhi_internal_dmac_complete_tasklet_fn(unsigned long arg)
if (dir == DMA_FROM_DEVICE) if (dir == DMA_FROM_DEVICE)
clear_bit(SDHI_INTERNAL_DMAC_RX_IN_USE, &global_flags); clear_bit(SDHI_INTERNAL_DMAC_RX_IN_USE, &global_flags);
return true;
}
static void renesas_sdhi_internal_dmac_complete_tasklet_fn(unsigned long arg)
{
struct tmio_mmc_host *host = (struct tmio_mmc_host *)arg;
spin_lock_irq(&host->lock);
if (!renesas_sdhi_internal_dmac_complete(host))
goto out;
tmio_mmc_do_data_irq(host); tmio_mmc_do_data_irq(host);
out: out:
spin_unlock_irq(&host->lock); spin_unlock_irq(&host->lock);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment