hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
kernel/drivers/dma/txx9dmac.c
....@@ -1,11 +1,8 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * Driver for the TXx9 SoC DMA Controller
34 *
45 * Copyright (C) 2009 Atsushi Nemoto
5
- *
6
- * This program is free software; you can redistribute it and/or modify
7
- * it under the terms of the GNU General Public License version 2 as
8
- * published by the Free Software Foundation.
96 */
107 #include <linux/dma-mapping.h>
118 #include <linux/init.h>
....@@ -327,7 +324,6 @@
327324 channel_writel(dc, SAIR, 0);
328325 channel_writel(dc, DAIR, 0);
329326 channel_writel(dc, CCR, 0);
330
- mmiowb();
331327 }
332328
333329 /* Called with dc->lock held and bh disabled */
....@@ -605,13 +601,13 @@
605601 }
606602 }
607603
608
-static void txx9dmac_chan_tasklet(unsigned long data)
604
+static void txx9dmac_chan_tasklet(struct tasklet_struct *t)
609605 {
610606 int irq;
611607 u32 csr;
612608 struct txx9dmac_chan *dc;
613609
614
- dc = (struct txx9dmac_chan *)data;
610
+ dc = from_tasklet(dc, t, tasklet);
615611 csr = channel_readl(dc, CSR);
616612 dev_vdbg(chan2dev(&dc->chan), "tasklet: status=%x\n", csr);
617613
....@@ -642,13 +638,13 @@
642638 return IRQ_HANDLED;
643639 }
644640
645
-static void txx9dmac_tasklet(unsigned long data)
641
+static void txx9dmac_tasklet(struct tasklet_struct *t)
646642 {
647643 int irq;
648644 u32 csr;
649645 struct txx9dmac_chan *dc;
650646
651
- struct txx9dmac_dev *ddev = (struct txx9dmac_dev *)data;
647
+ struct txx9dmac_dev *ddev = from_tasklet(ddev, t, tasklet);
652648 u32 mcr;
653649 int i;
654650
....@@ -954,7 +950,6 @@
954950 dma_sync_single_for_device(chan2parent(&dc->chan),
955951 prev->txd.phys, ddev->descsize,
956952 DMA_TO_DEVICE);
957
- mmiowb();
958953 if (!(channel_readl(dc, CSR) & TXX9_DMA_CSR_CHNEN) &&
959954 channel_read_CHAR(dc) == prev->txd.phys)
960955 /* Restart chain DMA */
....@@ -1080,7 +1075,6 @@
10801075 static void txx9dmac_off(struct txx9dmac_dev *ddev)
10811076 {
10821077 dma_writel(ddev, MCR, 0);
1083
- mmiowb();
10841078 }
10851079
10861080 static int __init txx9dmac_chan_probe(struct platform_device *pdev)
....@@ -1119,8 +1113,7 @@
11191113 irq = platform_get_irq(pdev, 0);
11201114 if (irq < 0)
11211115 return irq;
1122
- tasklet_init(&dc->tasklet, txx9dmac_chan_tasklet,
1123
- (unsigned long)dc);
1116
+ tasklet_setup(&dc->tasklet, txx9dmac_chan_tasklet);
11241117 dc->irq = irq;
11251118 err = devm_request_irq(&pdev->dev, dc->irq,
11261119 txx9dmac_chan_interrupt, 0, dev_name(&pdev->dev), dc);
....@@ -1206,8 +1199,7 @@
12061199
12071200 ddev->irq = platform_get_irq(pdev, 0);
12081201 if (ddev->irq >= 0) {
1209
- tasklet_init(&ddev->tasklet, txx9dmac_tasklet,
1210
- (unsigned long)ddev);
1202
+ tasklet_setup(&ddev->tasklet, txx9dmac_tasklet);
12111203 err = devm_request_irq(&pdev->dev, ddev->irq,
12121204 txx9dmac_interrupt, 0, dev_name(&pdev->dev), ddev);
12131205 if (err)