hc
2023-12-11 d2ccde1c8e90d38cee87a1b0309ad2827f3fd30d
kernel/drivers/dma/sa11x0-dma.c
....@@ -1,13 +1,10 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * SA11x0 DMAengine support
34 *
45 * Copyright (C) 2012 Russell King
56 * Derived in part from arch/arm/mach-sa1100/dma.c,
67 * Copyright (C) 2000, 2001 by Nicolas Pitre
7
- *
8
- * This program is free software; you can redistribute it and/or modify
9
- * it under the terms of the GNU General Public License version 2 as
10
- * published by the Free Software Foundation.
118 */
129 #include <linux/sched.h>
1310 #include <linux/device.h>
....@@ -17,7 +14,6 @@
1714 #include <linux/kernel.h>
1815 #include <linux/module.h>
1916 #include <linux/platform_device.h>
20
-#include <linux/sa11x0-dma.h>
2117 #include <linux/slab.h>
2218 #include <linux/spinlock.h>
2319
....@@ -82,7 +78,7 @@
8278 bool cyclic;
8379
8480 unsigned sglen;
85
- struct sa11x0_dma_sg sg[0];
81
+ struct sa11x0_dma_sg sg[];
8682 };
8783
8884 struct sa11x0_dma_phy;
....@@ -327,9 +323,9 @@
327323 }
328324 }
329325
330
-static void sa11x0_dma_tasklet(unsigned long arg)
326
+static void sa11x0_dma_tasklet(struct tasklet_struct *t)
331327 {
332
- struct sa11x0_dma_dev *d = (struct sa11x0_dma_dev *)arg;
328
+ struct sa11x0_dma_dev *d = from_tasklet(d, t, task);
333329 struct sa11x0_dma_phy *p;
334330 struct sa11x0_dma_chan *c;
335331 unsigned pch, pch_alloc = 0;
....@@ -706,7 +702,6 @@
706702 struct sa11x0_dma_chan *c = to_sa11x0_dma_chan(chan);
707703 struct sa11x0_dma_dev *d = to_sa11x0_dma(chan->device);
708704 struct sa11x0_dma_phy *p;
709
- LIST_HEAD(head);
710705 unsigned long flags;
711706
712707 dev_dbg(d->slave.dev, "vchan %p: pause\n", &c->vc);
....@@ -733,7 +728,6 @@
733728 struct sa11x0_dma_chan *c = to_sa11x0_dma_chan(chan);
734729 struct sa11x0_dma_dev *d = to_sa11x0_dma(chan->device);
735730 struct sa11x0_dma_phy *p;
736
- LIST_HEAD(head);
737731 unsigned long flags;
738732
739733 dev_dbg(d->slave.dev, "vchan %p: resume\n", &c->vc);
....@@ -829,6 +823,14 @@
829823 { "sa11x0-ssp", "tx", "Ser4SSPTr" },
830824 { "sa11x0-ssp", "rx", "Ser4SSPRc" },
831825 };
826
+
827
+static bool sa11x0_dma_filter_fn(struct dma_chan *chan, void *param)
828
+{
829
+ struct sa11x0_dma_chan *c = to_sa11x0_dma_chan(chan);
830
+ const char *p = param;
831
+
832
+ return !strcmp(c->name, p);
833
+}
832834
833835 static int sa11x0_dma_init_dmadev(struct dma_device *dmadev,
834836 struct device *dev)
....@@ -926,7 +928,7 @@
926928 goto err_ioremap;
927929 }
928930
929
- tasklet_init(&d->task, sa11x0_dma_tasklet, (unsigned long)d);
931
+ tasklet_setup(&d->task, sa11x0_dma_tasklet);
930932
931933 for (i = 0; i < NR_PHY_CHAN; i++) {
932934 struct sa11x0_dma_phy *p = &d->phy[i];
....@@ -1086,18 +1088,6 @@
10861088 .probe = sa11x0_dma_probe,
10871089 .remove = sa11x0_dma_remove,
10881090 };
1089
-
1090
-bool sa11x0_dma_filter_fn(struct dma_chan *chan, void *param)
1091
-{
1092
- if (chan->device->dev->driver == &sa11x0_dma_driver.driver) {
1093
- struct sa11x0_dma_chan *c = to_sa11x0_dma_chan(chan);
1094
- const char *p = param;
1095
-
1096
- return !strcmp(c->name, p);
1097
- }
1098
- return false;
1099
-}
1100
-EXPORT_SYMBOL(sa11x0_dma_filter_fn);
11011091
11021092 static int __init sa11x0_dma_init(void)
11031093 {