dmaengine: imx-dma: convert tasklets to use new tasklet_setup() API
authorAllen Pais <allen.lkml@gmail.com>
Mon, 31 Aug 2020 10:35:15 +0000 (16:05 +0530)
committerVinod Koul <vkoul@kernel.org>
Fri, 18 Sep 2020 06:49:06 +0000 (12:19 +0530)
In preparation for unconditionally passing the
struct tasklet_struct pointer to all tasklet
callbacks, switch to using the new tasklet_setup()
and from_tasklet() to pass the tasklet pointer explicitly.

Signed-off-by: Romain Perier <romain.perier@gmail.com>
Signed-off-by: Allen Pais <allen.lkml@gmail.com>
Link: https://lore.kernel.org/r/20200831103542.305571-9-allen.lkml@gmail.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
drivers/dma/imx-dma.c

index 67ac2e6..670db04 100644 (file)
@@ -612,9 +612,9 @@ static int imxdma_xfer_desc(struct imxdma_desc *d)
        return 0;
 }
 
-static void imxdma_tasklet(unsigned long data)
+static void imxdma_tasklet(struct tasklet_struct *t)
 {
-       struct imxdma_channel *imxdmac = (void *)data;
+       struct imxdma_channel *imxdmac = from_tasklet(imxdmac, t, dma_tasklet);
        struct imxdma_engine *imxdma = imxdmac->imxdma;
        struct imxdma_desc *desc, *next_desc;
        unsigned long flags;
@@ -1168,8 +1168,7 @@ static int __init imxdma_probe(struct platform_device *pdev)
                INIT_LIST_HEAD(&imxdmac->ld_free);
                INIT_LIST_HEAD(&imxdmac->ld_active);
 
-               tasklet_init(&imxdmac->dma_tasklet, imxdma_tasklet,
-                            (unsigned long)imxdmac);
+               tasklet_setup(&imxdmac->dma_tasklet, imxdma_tasklet);
                imxdmac->chan.device = &imxdma->dma_device;
                dma_cookie_init(&imxdmac->chan);
                imxdmac->channel = i;