dmaengine: xilinx: convert tasklets to use new tasklet_setup() API
authorAllen Pais <allen.lkml@gmail.com>
Mon, 31 Aug 2020 10:35:39 +0000 (16:05 +0530)
committerVinod Koul <vkoul@kernel.org>
Fri, 18 Sep 2020 06:49:07 +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-33-allen.lkml@gmail.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
drivers/dma/xilinx/xilinx_dma.c
drivers/dma/xilinx/zynqmp_dma.c

index 286cf94a950d93452487b111ff364c370bc526e4..a9eb85ee6daff1bc8bd5c880d0e233270cdcac5e 100644 (file)
@@ -1046,9 +1046,9 @@ static void xilinx_dma_chan_desc_cleanup(struct xilinx_dma_chan *chan)
  * xilinx_dma_do_tasklet - Schedule completion tasklet
  * @data: Pointer to the Xilinx DMA channel structure
  */
-static void xilinx_dma_do_tasklet(unsigned long data)
+static void xilinx_dma_do_tasklet(struct tasklet_struct *t)
 {
-       struct xilinx_dma_chan *chan = (struct xilinx_dma_chan *)data;
+       struct xilinx_dma_chan *chan = from_tasklet(chan, t, tasklet);
 
        xilinx_dma_chan_desc_cleanup(chan);
 }
@@ -2846,8 +2846,7 @@ static int xilinx_dma_chan_probe(struct xilinx_dma_device *xdev,
        }
 
        /* Initialize the tasklet */
-       tasklet_init(&chan->tasklet, xilinx_dma_do_tasklet,
-                       (unsigned long)chan);
+       tasklet_setup(&chan->tasklet, xilinx_dma_do_tasklet);
 
        /*
         * Initialize the DMA channel and add it to the DMA engine channels
index ff253696d1833c1ea8357ff021a652fd341e23cb..15b0f961fdf8dc764c73e80745cfb2d6826a4636 100644 (file)
@@ -744,9 +744,9 @@ static irqreturn_t zynqmp_dma_irq_handler(int irq, void *data)
  * zynqmp_dma_do_tasklet - Schedule completion tasklet
  * @data: Pointer to the ZynqMP DMA channel structure
  */
-static void zynqmp_dma_do_tasklet(unsigned long data)
+static void zynqmp_dma_do_tasklet(struct tasklet_struct *t)
 {
-       struct zynqmp_dma_chan *chan = (struct zynqmp_dma_chan *)data;
+       struct zynqmp_dma_chan *chan = from_tasklet(chan, t, tasklet);
        u32 count;
        unsigned long irqflags;
 
@@ -908,7 +908,7 @@ static int zynqmp_dma_chan_probe(struct zynqmp_dma_device *zdev,
 
        chan->is_dmacoherent =  of_property_read_bool(node, "dma-coherent");
        zdev->chan = chan;
-       tasklet_init(&chan->tasklet, zynqmp_dma_do_tasklet, (ulong)chan);
+       tasklet_setup(&chan->tasklet, zynqmp_dma_do_tasklet);
        spin_lock_init(&chan->lock);
        INIT_LIST_HEAD(&chan->active_list);
        INIT_LIST_HEAD(&chan->pending_list);