hc
2024-05-13 9d77db3c730780c8ef5ccd4b66403ff5675cfe4e
kernel/drivers/dma/s3c24xx-dma.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * S3C24XX DMA handling
34 *
....@@ -10,11 +11,6 @@
1011 *
1112 * Author: Peter Pearse <peter.pearse@arm.com>
1213 * Author: Linus Walleij <linus.walleij@stericsson.com>
13
- *
14
- * This program is free software; you can redistribute it and/or modify it
15
- * under the terms of the GNU General Public License as published by the Free
16
- * Software Foundation; either version 2 of the License, or (at your option)
17
- * any later version.
1814 *
1915 * The DMA controllers in S3C24XX SoCs have a varying number of DMA signals
2016 * that can be routed to any of the 4 to 8 hardware-channels.
....@@ -523,15 +519,6 @@
523519 s3c24xx_dma_start_next_sg(s3cchan, txd);
524520 }
525521
526
-static void s3c24xx_dma_free_txd_list(struct s3c24xx_dma_engine *s3cdma,
527
- struct s3c24xx_dma_chan *s3cchan)
528
-{
529
- LIST_HEAD(head);
530
-
531
- vchan_get_all_descriptors(&s3cchan->vc, &head);
532
- vchan_dma_desc_free_list(&s3cchan->vc, &head);
533
-}
534
-
535522 /*
536523 * Try to allocate a physical channel. When successful, assign it to
537524 * this virtual channel, and initiate the next descriptor. The
....@@ -713,8 +700,9 @@
713700 {
714701 struct s3c24xx_dma_chan *s3cchan = to_s3c24xx_dma_chan(chan);
715702 struct s3c24xx_dma_engine *s3cdma = s3cchan->host;
703
+ LIST_HEAD(head);
716704 unsigned long flags;
717
- int ret = 0;
705
+ int ret;
718706
719707 spin_lock_irqsave(&s3cchan->vc.lock, flags);
720708
....@@ -738,7 +726,15 @@
738726 }
739727
740728 /* Dequeue jobs not yet fired as well */
741
- s3c24xx_dma_free_txd_list(s3cdma, s3cchan);
729
+
730
+ vchan_get_all_descriptors(&s3cchan->vc, &head);
731
+
732
+ spin_unlock_irqrestore(&s3cchan->vc.lock, flags);
733
+
734
+ vchan_dma_desc_free_list(&s3cchan->vc, &head);
735
+
736
+ return 0;
737
+
742738 unlock:
743739 spin_unlock_irqrestore(&s3cchan->vc.lock, flags);
744740
....@@ -1202,7 +1198,7 @@
12021198
12031199 /* Basic sanity check */
12041200 if (pdata->num_phy_channels > MAX_DMA_CHANNELS) {
1205
- dev_err(&pdev->dev, "to many dma channels %d, max %d\n",
1201
+ dev_err(&pdev->dev, "too many dma channels %d, max %d\n",
12061202 pdata->num_phy_channels, MAX_DMA_CHANNELS);
12071203 return -EINVAL;
12081204 }
....@@ -1241,11 +1237,8 @@
12411237 phy->host = s3cdma;
12421238
12431239 phy->irq = platform_get_irq(pdev, i);
1244
- if (phy->irq < 0) {
1245
- dev_err(&pdev->dev, "failed to get irq %d, err %d\n",
1246
- i, phy->irq);
1240
+ if (phy->irq < 0)
12471241 continue;
1248
- }
12491242
12501243 ret = devm_request_irq(&pdev->dev, phy->irq, s3c24xx_dma_irq,
12511244 0, pdev->name, phy);