Skip to content

Commit 388a802

Browse files
shimodaygregkh
authored andcommitted
mmc: renesas_sdhi_internal_dmac: clean up the code for dma complete
[ Upstream commit 2b26e34 ] To add end() operation in the future, clean the code of renesas_sdhi_internal_dmac_complete_tasklet_fn(). No behavior change. Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com> Link: https://lore.kernel.org/r/1590044466-28372-3-git-send-email-yoshihiro.shimoda.uh@renesas.com Tested-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent e9bca40 commit 388a802

1 file changed

Lines changed: 13 additions & 5 deletions

File tree

drivers/mmc/host/renesas_sdhi_internal_dmac.c

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -222,15 +222,12 @@ static void renesas_sdhi_internal_dmac_issue_tasklet_fn(unsigned long arg)
222222
DTRAN_CTRL_DM_START);
223223
}
224224

225-
static void renesas_sdhi_internal_dmac_complete_tasklet_fn(unsigned long arg)
225+
static bool renesas_sdhi_internal_dmac_complete(struct tmio_mmc_host *host)
226226
{
227-
struct tmio_mmc_host *host = (struct tmio_mmc_host *)arg;
228227
enum dma_data_direction dir;
229228

230-
spin_lock_irq(&host->lock);
231-
232229
if (!host->data)
233-
goto out;
230+
return false;
234231

235232
if (host->data->flags & MMC_DATA_READ)
236233
dir = DMA_FROM_DEVICE;
@@ -243,6 +240,17 @@ static void renesas_sdhi_internal_dmac_complete_tasklet_fn(unsigned long arg)
243240
if (dir == DMA_FROM_DEVICE)
244241
clear_bit(SDHI_INTERNAL_DMAC_RX_IN_USE, &global_flags);
245242

243+
return true;
244+
}
245+
246+
static void renesas_sdhi_internal_dmac_complete_tasklet_fn(unsigned long arg)
247+
{
248+
struct tmio_mmc_host *host = (struct tmio_mmc_host *)arg;
249+
250+
spin_lock_irq(&host->lock);
251+
if (!renesas_sdhi_internal_dmac_complete(host))
252+
goto out;
253+
246254
tmio_mmc_do_data_irq(host);
247255
out:
248256
spin_unlock_irq(&host->lock);

0 commit comments

Comments
 (0)