Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

dmaengine: ioat: convert tasklets to use new tasklet_setup() API

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>
Acked-by: Dave Jiang <dave.jiang@intel.com>
Link: https://lore.kernel.org/r/20200831103542.305571-10-allen.lkml@gmail.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>

authored by

Allen Pais and committed by
Vinod Koul
3b8040de cce010a5

+5 -7
+3 -3
drivers/dma/ioat/dma.c
··· 165 165 tasklet_kill(&ioat_chan->cleanup_task); 166 166 167 167 /* final cleanup now that everything is quiesced and can't re-arm */ 168 - ioat_cleanup_event((unsigned long)&ioat_chan->dma_chan); 168 + ioat_cleanup_event(&ioat_chan->cleanup_task); 169 169 } 170 170 171 171 static void __ioat_issue_pending(struct ioatdma_chan *ioat_chan) ··· 690 690 spin_unlock_bh(&ioat_chan->cleanup_lock); 691 691 } 692 692 693 - void ioat_cleanup_event(unsigned long data) 693 + void ioat_cleanup_event(struct tasklet_struct *t) 694 694 { 695 - struct ioatdma_chan *ioat_chan = to_ioat_chan((void *)data); 695 + struct ioatdma_chan *ioat_chan = from_tasklet(ioat_chan, t, cleanup_task); 696 696 697 697 ioat_cleanup(ioat_chan); 698 698 if (!test_bit(IOAT_RUN, &ioat_chan->state))
+1 -1
drivers/dma/ioat/dma.h
··· 393 393 enum dma_status 394 394 ioat_tx_status(struct dma_chan *c, dma_cookie_t cookie, 395 395 struct dma_tx_state *txstate); 396 - void ioat_cleanup_event(unsigned long data); 396 + void ioat_cleanup_event(struct tasklet_struct *t); 397 397 void ioat_timer_event(struct timer_list *t); 398 398 int ioat_check_space_lock(struct ioatdma_chan *ioat_chan, int num_descs); 399 399 void ioat_issue_pending(struct dma_chan *chan);
+1 -3
drivers/dma/ioat/init.c
··· 767 767 struct ioatdma_chan *ioat_chan, int idx) 768 768 { 769 769 struct dma_device *dma = &ioat_dma->dma_dev; 770 - struct dma_chan *c = &ioat_chan->dma_chan; 771 - unsigned long data = (unsigned long) c; 772 770 773 771 ioat_chan->ioat_dma = ioat_dma; 774 772 ioat_chan->reg_base = ioat_dma->reg_base + (0x80 * (idx + 1)); ··· 776 778 list_add_tail(&ioat_chan->dma_chan.device_node, &dma->channels); 777 779 ioat_dma->idx[idx] = ioat_chan; 778 780 timer_setup(&ioat_chan->timer, ioat_timer_event, 0); 779 - tasklet_init(&ioat_chan->cleanup_task, ioat_cleanup_event, data); 781 + tasklet_setup(&ioat_chan->cleanup_task, ioat_cleanup_event); 780 782 } 781 783 782 784 #define IOAT_NUM_SRC_TEST 6 /* must be <= 8 */