.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
---|
1 | 2 | /* |
---|
2 | 3 | * Driver for the TXx9 SoC DMA Controller |
---|
3 | 4 | * |
---|
4 | 5 | * 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. |
---|
9 | 6 | */ |
---|
10 | 7 | #include <linux/dma-mapping.h> |
---|
11 | 8 | #include <linux/init.h> |
---|
.. | .. |
---|
327 | 324 | channel_writel(dc, SAIR, 0); |
---|
328 | 325 | channel_writel(dc, DAIR, 0); |
---|
329 | 326 | channel_writel(dc, CCR, 0); |
---|
330 | | - mmiowb(); |
---|
331 | 327 | } |
---|
332 | 328 | |
---|
333 | 329 | /* Called with dc->lock held and bh disabled */ |
---|
.. | .. |
---|
605 | 601 | } |
---|
606 | 602 | } |
---|
607 | 603 | |
---|
608 | | -static void txx9dmac_chan_tasklet(unsigned long data) |
---|
| 604 | +static void txx9dmac_chan_tasklet(struct tasklet_struct *t) |
---|
609 | 605 | { |
---|
610 | 606 | int irq; |
---|
611 | 607 | u32 csr; |
---|
612 | 608 | struct txx9dmac_chan *dc; |
---|
613 | 609 | |
---|
614 | | - dc = (struct txx9dmac_chan *)data; |
---|
| 610 | + dc = from_tasklet(dc, t, tasklet); |
---|
615 | 611 | csr = channel_readl(dc, CSR); |
---|
616 | 612 | dev_vdbg(chan2dev(&dc->chan), "tasklet: status=%x\n", csr); |
---|
617 | 613 | |
---|
.. | .. |
---|
642 | 638 | return IRQ_HANDLED; |
---|
643 | 639 | } |
---|
644 | 640 | |
---|
645 | | -static void txx9dmac_tasklet(unsigned long data) |
---|
| 641 | +static void txx9dmac_tasklet(struct tasklet_struct *t) |
---|
646 | 642 | { |
---|
647 | 643 | int irq; |
---|
648 | 644 | u32 csr; |
---|
649 | 645 | struct txx9dmac_chan *dc; |
---|
650 | 646 | |
---|
651 | | - struct txx9dmac_dev *ddev = (struct txx9dmac_dev *)data; |
---|
| 647 | + struct txx9dmac_dev *ddev = from_tasklet(ddev, t, tasklet); |
---|
652 | 648 | u32 mcr; |
---|
653 | 649 | int i; |
---|
654 | 650 | |
---|
.. | .. |
---|
954 | 950 | dma_sync_single_for_device(chan2parent(&dc->chan), |
---|
955 | 951 | prev->txd.phys, ddev->descsize, |
---|
956 | 952 | DMA_TO_DEVICE); |
---|
957 | | - mmiowb(); |
---|
958 | 953 | if (!(channel_readl(dc, CSR) & TXX9_DMA_CSR_CHNEN) && |
---|
959 | 954 | channel_read_CHAR(dc) == prev->txd.phys) |
---|
960 | 955 | /* Restart chain DMA */ |
---|
.. | .. |
---|
1080 | 1075 | static void txx9dmac_off(struct txx9dmac_dev *ddev) |
---|
1081 | 1076 | { |
---|
1082 | 1077 | dma_writel(ddev, MCR, 0); |
---|
1083 | | - mmiowb(); |
---|
1084 | 1078 | } |
---|
1085 | 1079 | |
---|
1086 | 1080 | static int __init txx9dmac_chan_probe(struct platform_device *pdev) |
---|
.. | .. |
---|
1119 | 1113 | irq = platform_get_irq(pdev, 0); |
---|
1120 | 1114 | if (irq < 0) |
---|
1121 | 1115 | return irq; |
---|
1122 | | - tasklet_init(&dc->tasklet, txx9dmac_chan_tasklet, |
---|
1123 | | - (unsigned long)dc); |
---|
| 1116 | + tasklet_setup(&dc->tasklet, txx9dmac_chan_tasklet); |
---|
1124 | 1117 | dc->irq = irq; |
---|
1125 | 1118 | err = devm_request_irq(&pdev->dev, dc->irq, |
---|
1126 | 1119 | txx9dmac_chan_interrupt, 0, dev_name(&pdev->dev), dc); |
---|
.. | .. |
---|
1206 | 1199 | |
---|
1207 | 1200 | ddev->irq = platform_get_irq(pdev, 0); |
---|
1208 | 1201 | if (ddev->irq >= 0) { |
---|
1209 | | - tasklet_init(&ddev->tasklet, txx9dmac_tasklet, |
---|
1210 | | - (unsigned long)ddev); |
---|
| 1202 | + tasklet_setup(&ddev->tasklet, txx9dmac_tasklet); |
---|
1211 | 1203 | err = devm_request_irq(&pdev->dev, ddev->irq, |
---|
1212 | 1204 | txx9dmac_interrupt, 0, dev_name(&pdev->dev), ddev); |
---|
1213 | 1205 | if (err) |
---|