@@ -48,6 +48,7 @@ struct tmio_mmc_dma {
};
struct renesas_sdhi {
+ struct platform_device *pdev;
struct clk *clk;
struct clk *clk_cd;
struct tmio_mmc_data mmc_data;
@@ -975,6 +975,8 @@ int renesas_sdhi_probe(struct platform_device *pdev,
goto eirq;
}
+ priv->pdev = pdev;
+
dev_info(&pdev->dev, "%s base at %pa, max clock rate %u MHz\n",
mmc_hostname(host->mmc), &res->start, host->mmc->f_max / 1000000);
@@ -218,9 +218,9 @@ renesas_sdhi_internal_dmac_start_dma(struct tmio_mmc_host *host,
renesas_sdhi_internal_dmac_enable_dma(host, false);
}
-static void renesas_sdhi_internal_dmac_issue_tasklet_fn(unsigned long arg)
+static void renesas_sdhi_internal_dmac_issue_tasklet_fn(struct tasklet_struct *t)
{
- struct tmio_mmc_host *host = (struct tmio_mmc_host *)arg;
+ struct tmio_mmc_host *host = from_tasklet(host, t, dma_issue);
tmio_mmc_enable_mmc_irqs(host, TMIO_STAT_DATAEND);
@@ -255,9 +255,11 @@ static bool renesas_sdhi_internal_dmac_complete(struct tmio_mmc_host *host)
return true;
}
-static void renesas_sdhi_internal_dmac_complete_tasklet_fn(unsigned long arg)
+static void renesas_sdhi_internal_dmac_complete_tasklet_fn(struct tasklet_struct *t)
{
- struct tmio_mmc_host *host = (struct tmio_mmc_host *)arg;
+ struct renesas_sdhi *priv = from_tasklet(priv, t,
+ dma_priv.dma_complete);
+ struct tmio_mmc_host *host = platform_get_drvdata(priv->pdev);
spin_lock_irq(&host->lock);
if (!renesas_sdhi_internal_dmac_complete(host))
@@ -289,12 +291,10 @@ renesas_sdhi_internal_dmac_request_dma(struct tmio_mmc_host *host,
/* Each value is set to non-zero to assume "enabling" each DMA */
host->chan_rx = host->chan_tx = (void *)0xdeadbeaf;
- tasklet_init(&priv->dma_priv.dma_complete,
- renesas_sdhi_internal_dmac_complete_tasklet_fn,
- (unsigned long)host);
- tasklet_init(&host->dma_issue,
- renesas_sdhi_internal_dmac_issue_tasklet_fn,
- (unsigned long)host);
+ tasklet_setup(&priv->dma_priv.dma_complete,
+ renesas_sdhi_internal_dmac_complete_tasklet_fn);
+ tasklet_setup(&host->dma_issue,
+ renesas_sdhi_internal_dmac_issue_tasklet_fn);
}
static void
@@ -310,9 +310,9 @@ static void renesas_sdhi_sys_dmac_start_dma(struct tmio_mmc_host *host,
}
}
-static void renesas_sdhi_sys_dmac_issue_tasklet_fn(unsigned long priv)
+static void renesas_sdhi_sys_dmac_issue_tasklet_fn(struct tasklet_struct *t)
{
- struct tmio_mmc_host *host = (struct tmio_mmc_host *)priv;
+ struct tmio_mmc_host *host = from_tasklet(host, t, dma_issue);
struct dma_chan *chan = NULL;
spin_lock_irq(&host->lock);
@@ -399,9 +399,8 @@ static void renesas_sdhi_sys_dmac_request_dma(struct tmio_mmc_host *host,
goto ebouncebuf;
init_completion(&priv->dma_priv.dma_dataend);
- tasklet_init(&host->dma_issue,
- renesas_sdhi_sys_dmac_issue_tasklet_fn,
- (unsigned long)host);
+ tasklet_setup(&host->dma_issue,
+ renesas_sdhi_sys_dmac_issue_tasklet_fn);
}
renesas_sdhi_sys_dmac_enable_dma(host, true);