Commit 16052827d98fbc13c31ebad560af4bd53e2b4dd5
Committed by
Vinod Koul
1 parent
ad1122e545
Exists in
smarc-l5.0.0_1.0.0-ga
and in
5 other branches
dmaengine/dma_slave: introduce inline wrappers
Add inline wrappers for device_prep_slave_sg() and device_prep_dma_cyclic() interfaces to hide new parameter from current users of affected interfaces. Convert current users to use new wrappers instead of direct calls. Suggested by Russell King [https://lkml.org/lkml/2012/2/3/269]. Signed-off-by: Alexandre Bounine <alexandre.bounine@idt.com> Signed-off-by: Vinod Koul <vinod.koul@linux.intel.com>
Showing 28 changed files with 67 additions and 60 deletions Side-by-side Diff
- arch/arm/plat-nomadik/include/plat/ste_dma40.h
- arch/arm/plat-samsung/dma-ops.c
- drivers/media/video/mx3_camera.c
- drivers/media/video/timblogiw.c
- drivers/mmc/host/atmel-mci.c
- drivers/mmc/host/mmci.c
- drivers/mmc/host/mxcmmc.c
- drivers/mmc/host/mxs-mmc.c
- drivers/mmc/host/sh_mmcif.c
- drivers/mmc/host/tmio_mmc_dma.c
- drivers/mtd/nand/gpmi-nand/gpmi-lib.c
- drivers/net/ethernet/micrel/ks8842.c
- drivers/spi/spi-dw-mid.c
- drivers/spi/spi-ep93xx.c
- drivers/spi/spi-pl022.c
- drivers/spi/spi-topcliff-pch.c
- drivers/tty/serial/amba-pl011.c
- drivers/tty/serial/pch_uart.c
- drivers/tty/serial/sh-sci.c
- drivers/usb/musb/ux500_dma.c
- drivers/usb/renesas_usbhs/fifo.c
- drivers/video/mx3fb.c
- include/linux/dmaengine.h
- sound/soc/ep93xx/ep93xx-pcm.c
- sound/soc/imx/imx-pcm-dma-mx2.c
- sound/soc/mxs/mxs-pcm.c
- sound/soc/sh/siu_pcm.c
- sound/soc/txx9/txx9aclc.c
arch/arm/plat-nomadik/include/plat/ste_dma40.h
arch/arm/plat-samsung/dma-ops.c
... | ... | @@ -79,11 +79,11 @@ |
79 | 79 | info->len, offset_in_page(info->buf)); |
80 | 80 | sg_dma_address(&sg) = info->buf; |
81 | 81 | |
82 | - desc = chan->device->device_prep_slave_sg(chan, | |
82 | + desc = dmaengine_prep_slave_sg(chan, | |
83 | 83 | &sg, 1, info->direction, DMA_PREP_INTERRUPT); |
84 | 84 | break; |
85 | 85 | case DMA_CYCLIC: |
86 | - desc = chan->device->device_prep_dma_cyclic(chan, | |
86 | + desc = dmaengine_prep_dma_cyclic(chan, | |
87 | 87 | info->buf, info->len, info->period, info->direction); |
88 | 88 | break; |
89 | 89 | default: |
drivers/media/video/mx3_camera.c
... | ... | @@ -286,7 +286,7 @@ |
286 | 286 | sg_dma_address(sg) = vb2_dma_contig_plane_dma_addr(vb, 0); |
287 | 287 | sg_dma_len(sg) = new_size; |
288 | 288 | |
289 | - txd = ichan->dma_chan.device->device_prep_slave_sg( | |
289 | + txd = dmaengine_prep_slave_sg( | |
290 | 290 | &ichan->dma_chan, sg, 1, DMA_DEV_TO_MEM, |
291 | 291 | DMA_PREP_INTERRUPT); |
292 | 292 | if (!txd) |
drivers/media/video/timblogiw.c
... | ... | @@ -564,7 +564,7 @@ |
564 | 564 | |
565 | 565 | spin_unlock_irq(&fh->queue_lock); |
566 | 566 | |
567 | - desc = fh->chan->device->device_prep_slave_sg(fh->chan, | |
567 | + desc = dmaengine_prep_slave_sg(fh->chan, | |
568 | 568 | buf->sg, sg_elems, DMA_DEV_TO_MEM, |
569 | 569 | DMA_PREP_INTERRUPT | DMA_COMPL_SKIP_SRC_UNMAP); |
570 | 570 | if (!desc) { |
drivers/mmc/host/atmel-mci.c
... | ... | @@ -875,7 +875,7 @@ |
875 | 875 | data->sg_len, direction); |
876 | 876 | |
877 | 877 | dmaengine_slave_config(chan, &host->dma_conf); |
878 | - desc = chan->device->device_prep_slave_sg(chan, | |
878 | + desc = dmaengine_prep_slave_sg(chan, | |
879 | 879 | data->sg, sglen, slave_dirn, |
880 | 880 | DMA_PREP_INTERRUPT | DMA_CTRL_ACK); |
881 | 881 | if (!desc) |
drivers/mmc/host/mmci.c
... | ... | @@ -413,7 +413,7 @@ |
413 | 413 | return -EINVAL; |
414 | 414 | |
415 | 415 | dmaengine_slave_config(chan, &conf); |
416 | - desc = device->device_prep_slave_sg(chan, data->sg, nr_sg, | |
416 | + desc = dmaengine_prep_slave_sg(chan, data->sg, nr_sg, | |
417 | 417 | conf.direction, DMA_CTRL_ACK); |
418 | 418 | if (!desc) |
419 | 419 | goto unmap_exit; |
drivers/mmc/host/mxcmmc.c
... | ... | @@ -255,7 +255,7 @@ |
255 | 255 | if (nents != data->sg_len) |
256 | 256 | return -EINVAL; |
257 | 257 | |
258 | - host->desc = host->dma->device->device_prep_slave_sg(host->dma, | |
258 | + host->desc = dmaengine_prep_slave_sg(host->dma, | |
259 | 259 | data->sg, data->sg_len, slave_dirn, |
260 | 260 | DMA_PREP_INTERRUPT | DMA_CTRL_ACK); |
261 | 261 |
drivers/mmc/host/mxs-mmc.c
... | ... | @@ -324,7 +324,7 @@ |
324 | 324 | sg_len = SSP_PIO_NUM; |
325 | 325 | } |
326 | 326 | |
327 | - desc = host->dmach->device->device_prep_slave_sg(host->dmach, | |
327 | + desc = dmaengine_prep_slave_sg(host->dmach, | |
328 | 328 | sgl, sg_len, host->slave_dirn, append); |
329 | 329 | if (desc) { |
330 | 330 | desc->callback = mxs_mmc_dma_irq_callback; |
drivers/mmc/host/sh_mmcif.c
... | ... | @@ -285,7 +285,7 @@ |
285 | 285 | DMA_FROM_DEVICE); |
286 | 286 | if (ret > 0) { |
287 | 287 | host->dma_active = true; |
288 | - desc = chan->device->device_prep_slave_sg(chan, sg, ret, | |
288 | + desc = dmaengine_prep_slave_sg(chan, sg, ret, | |
289 | 289 | DMA_DEV_TO_MEM, DMA_PREP_INTERRUPT | DMA_CTRL_ACK); |
290 | 290 | } |
291 | 291 | |
... | ... | @@ -334,7 +334,7 @@ |
334 | 334 | DMA_TO_DEVICE); |
335 | 335 | if (ret > 0) { |
336 | 336 | host->dma_active = true; |
337 | - desc = chan->device->device_prep_slave_sg(chan, sg, ret, | |
337 | + desc = dmaengine_prep_slave_sg(chan, sg, ret, | |
338 | 338 | DMA_MEM_TO_DEV, DMA_PREP_INTERRUPT | DMA_CTRL_ACK); |
339 | 339 | } |
340 | 340 |
drivers/mmc/host/tmio_mmc_dma.c
... | ... | @@ -76,7 +76,7 @@ |
76 | 76 | |
77 | 77 | ret = dma_map_sg(chan->device->dev, sg, host->sg_len, DMA_FROM_DEVICE); |
78 | 78 | if (ret > 0) |
79 | - desc = chan->device->device_prep_slave_sg(chan, sg, ret, | |
79 | + desc = dmaengine_prep_slave_sg(chan, sg, ret, | |
80 | 80 | DMA_DEV_TO_MEM, DMA_CTRL_ACK); |
81 | 81 | |
82 | 82 | if (desc) { |
... | ... | @@ -157,7 +157,7 @@ |
157 | 157 | |
158 | 158 | ret = dma_map_sg(chan->device->dev, sg, host->sg_len, DMA_TO_DEVICE); |
159 | 159 | if (ret > 0) |
160 | - desc = chan->device->device_prep_slave_sg(chan, sg, ret, | |
160 | + desc = dmaengine_prep_slave_sg(chan, sg, ret, | |
161 | 161 | DMA_MEM_TO_DEV, DMA_CTRL_ACK); |
162 | 162 | |
163 | 163 | if (desc) { |
drivers/mtd/nand/gpmi-nand/gpmi-lib.c
... | ... | @@ -825,7 +825,7 @@ |
825 | 825 | | BM_GPMI_CTRL0_ADDRESS_INCREMENT |
826 | 826 | | BF_GPMI_CTRL0_XFER_COUNT(this->command_length); |
827 | 827 | pio[1] = pio[2] = 0; |
828 | - desc = channel->device->device_prep_slave_sg(channel, | |
828 | + desc = dmaengine_prep_slave_sg(channel, | |
829 | 829 | (struct scatterlist *)pio, |
830 | 830 | ARRAY_SIZE(pio), DMA_TRANS_NONE, 0); |
831 | 831 | if (!desc) { |
... | ... | @@ -838,8 +838,7 @@ |
838 | 838 | |
839 | 839 | sg_init_one(sgl, this->cmd_buffer, this->command_length); |
840 | 840 | dma_map_sg(this->dev, sgl, 1, DMA_TO_DEVICE); |
841 | - desc = channel->device->device_prep_slave_sg(channel, | |
842 | - sgl, 1, DMA_MEM_TO_DEV, 1); | |
841 | + desc = dmaengine_prep_slave_sg(channel, sgl, 1, DMA_MEM_TO_DEV, 1); | |
843 | 842 | if (!desc) { |
844 | 843 | pr_err("step 2 error\n"); |
845 | 844 | return -1; |
... | ... | @@ -870,8 +869,7 @@ |
870 | 869 | | BF_GPMI_CTRL0_ADDRESS(address) |
871 | 870 | | BF_GPMI_CTRL0_XFER_COUNT(this->upper_len); |
872 | 871 | pio[1] = 0; |
873 | - desc = channel->device->device_prep_slave_sg(channel, | |
874 | - (struct scatterlist *)pio, | |
872 | + desc = dmaengine_prep_slave_sg(channel, (struct scatterlist *)pio, | |
875 | 873 | ARRAY_SIZE(pio), DMA_TRANS_NONE, 0); |
876 | 874 | if (!desc) { |
877 | 875 | pr_err("step 1 error\n"); |
... | ... | @@ -880,7 +878,7 @@ |
880 | 878 | |
881 | 879 | /* [2] send DMA request */ |
882 | 880 | prepare_data_dma(this, DMA_TO_DEVICE); |
883 | - desc = channel->device->device_prep_slave_sg(channel, &this->data_sgl, | |
881 | + desc = dmaengine_prep_slave_sg(channel, &this->data_sgl, | |
884 | 882 | 1, DMA_MEM_TO_DEV, 1); |
885 | 883 | if (!desc) { |
886 | 884 | pr_err("step 2 error\n"); |
... | ... | @@ -906,7 +904,7 @@ |
906 | 904 | | BF_GPMI_CTRL0_ADDRESS(BV_GPMI_CTRL0_ADDRESS__NAND_DATA) |
907 | 905 | | BF_GPMI_CTRL0_XFER_COUNT(this->upper_len); |
908 | 906 | pio[1] = 0; |
909 | - desc = channel->device->device_prep_slave_sg(channel, | |
907 | + desc = dmaengine_prep_slave_sg(channel, | |
910 | 908 | (struct scatterlist *)pio, |
911 | 909 | ARRAY_SIZE(pio), DMA_TRANS_NONE, 0); |
912 | 910 | if (!desc) { |
... | ... | @@ -916,8 +914,8 @@ |
916 | 914 | |
917 | 915 | /* [2] : send DMA request */ |
918 | 916 | prepare_data_dma(this, DMA_FROM_DEVICE); |
919 | - desc = channel->device->device_prep_slave_sg(channel, &this->data_sgl, | |
920 | - 1, DMA_DEV_TO_MEM, 1); | |
917 | + desc = dmaengine_prep_slave_sg(channel, &this->data_sgl, | |
918 | + 1, DMA_DEV_TO_MEM, 1); | |
921 | 919 | if (!desc) { |
922 | 920 | pr_err("step 2 error\n"); |
923 | 921 | return -1; |
... | ... | @@ -962,8 +960,7 @@ |
962 | 960 | pio[4] = payload; |
963 | 961 | pio[5] = auxiliary; |
964 | 962 | |
965 | - desc = channel->device->device_prep_slave_sg(channel, | |
966 | - (struct scatterlist *)pio, | |
963 | + desc = dmaengine_prep_slave_sg(channel, (struct scatterlist *)pio, | |
967 | 964 | ARRAY_SIZE(pio), DMA_TRANS_NONE, 0); |
968 | 965 | if (!desc) { |
969 | 966 | pr_err("step 2 error\n"); |
... | ... | @@ -997,7 +994,7 @@ |
997 | 994 | | BF_GPMI_CTRL0_ADDRESS(address) |
998 | 995 | | BF_GPMI_CTRL0_XFER_COUNT(0); |
999 | 996 | pio[1] = 0; |
1000 | - desc = channel->device->device_prep_slave_sg(channel, | |
997 | + desc = dmaengine_prep_slave_sg(channel, | |
1001 | 998 | (struct scatterlist *)pio, 2, |
1002 | 999 | DMA_TRANS_NONE, 0); |
1003 | 1000 | if (!desc) { |
... | ... | @@ -1026,7 +1023,7 @@ |
1026 | 1023 | pio[3] = geo->page_size; |
1027 | 1024 | pio[4] = payload; |
1028 | 1025 | pio[5] = auxiliary; |
1029 | - desc = channel->device->device_prep_slave_sg(channel, | |
1026 | + desc = dmaengine_prep_slave_sg(channel, | |
1030 | 1027 | (struct scatterlist *)pio, |
1031 | 1028 | ARRAY_SIZE(pio), DMA_TRANS_NONE, 1); |
1032 | 1029 | if (!desc) { |
... | ... | @@ -1045,7 +1042,7 @@ |
1045 | 1042 | | BF_GPMI_CTRL0_ADDRESS(address) |
1046 | 1043 | | BF_GPMI_CTRL0_XFER_COUNT(geo->page_size); |
1047 | 1044 | pio[1] = 0; |
1048 | - desc = channel->device->device_prep_slave_sg(channel, | |
1045 | + desc = dmaengine_prep_slave_sg(channel, | |
1049 | 1046 | (struct scatterlist *)pio, 2, |
1050 | 1047 | DMA_TRANS_NONE, 1); |
1051 | 1048 | if (!desc) { |
drivers/net/ethernet/micrel/ks8842.c
... | ... | @@ -458,7 +458,7 @@ |
458 | 458 | if (sg_dma_len(&ctl->sg) % 4) |
459 | 459 | sg_dma_len(&ctl->sg) += 4 - sg_dma_len(&ctl->sg) % 4; |
460 | 460 | |
461 | - ctl->adesc = ctl->chan->device->device_prep_slave_sg(ctl->chan, | |
461 | + ctl->adesc = dmaengine_prep_slave_sg(ctl->chan, | |
462 | 462 | &ctl->sg, 1, DMA_MEM_TO_DEV, |
463 | 463 | DMA_PREP_INTERRUPT | DMA_COMPL_SKIP_SRC_UNMAP); |
464 | 464 | if (!ctl->adesc) |
... | ... | @@ -570,7 +570,7 @@ |
570 | 570 | |
571 | 571 | sg_dma_len(sg) = DMA_BUFFER_SIZE; |
572 | 572 | |
573 | - ctl->adesc = ctl->chan->device->device_prep_slave_sg(ctl->chan, | |
573 | + ctl->adesc = dmaengine_prep_slave_sg(ctl->chan, | |
574 | 574 | sg, 1, DMA_DEV_TO_MEM, |
575 | 575 | DMA_PREP_INTERRUPT | DMA_COMPL_SKIP_SRC_UNMAP); |
576 | 576 |
drivers/spi/spi-dw-mid.c
... | ... | @@ -146,7 +146,7 @@ |
146 | 146 | dws->tx_sgl.dma_address = dws->tx_dma; |
147 | 147 | dws->tx_sgl.length = dws->len; |
148 | 148 | |
149 | - txdesc = txchan->device->device_prep_slave_sg(txchan, | |
149 | + txdesc = dmaengine_prep_slave_sg(txchan, | |
150 | 150 | &dws->tx_sgl, |
151 | 151 | 1, |
152 | 152 | DMA_MEM_TO_DEV, |
... | ... | @@ -169,7 +169,7 @@ |
169 | 169 | dws->rx_sgl.dma_address = dws->rx_dma; |
170 | 170 | dws->rx_sgl.length = dws->len; |
171 | 171 | |
172 | - rxdesc = rxchan->device->device_prep_slave_sg(rxchan, | |
172 | + rxdesc = dmaengine_prep_slave_sg(rxchan, | |
173 | 173 | &dws->rx_sgl, |
174 | 174 | 1, |
175 | 175 | DMA_DEV_TO_MEM, |
drivers/spi/spi-ep93xx.c
... | ... | @@ -633,8 +633,8 @@ |
633 | 633 | if (!nents) |
634 | 634 | return ERR_PTR(-ENOMEM); |
635 | 635 | |
636 | - txd = chan->device->device_prep_slave_sg(chan, sgt->sgl, nents, | |
637 | - slave_dirn, DMA_CTRL_ACK); | |
636 | + txd = dmaengine_prep_slave_sg(chan, sgt->sgl, nents, | |
637 | + slave_dirn, DMA_CTRL_ACK); | |
638 | 638 | if (!txd) { |
639 | 639 | dma_unmap_sg(chan->device->dev, sgt->sgl, sgt->nents, dir); |
640 | 640 | return ERR_PTR(-ENOMEM); |
drivers/spi/spi-pl022.c
... | ... | @@ -1040,7 +1040,7 @@ |
1040 | 1040 | goto err_tx_sgmap; |
1041 | 1041 | |
1042 | 1042 | /* Send both scatterlists */ |
1043 | - rxdesc = rxchan->device->device_prep_slave_sg(rxchan, | |
1043 | + rxdesc = dmaengine_prep_slave_sg(rxchan, | |
1044 | 1044 | pl022->sgt_rx.sgl, |
1045 | 1045 | rx_sglen, |
1046 | 1046 | DMA_DEV_TO_MEM, |
... | ... | @@ -1048,7 +1048,7 @@ |
1048 | 1048 | if (!rxdesc) |
1049 | 1049 | goto err_rxdesc; |
1050 | 1050 | |
1051 | - txdesc = txchan->device->device_prep_slave_sg(txchan, | |
1051 | + txdesc = dmaengine_prep_slave_sg(txchan, | |
1052 | 1052 | pl022->sgt_tx.sgl, |
1053 | 1053 | tx_sglen, |
1054 | 1054 | DMA_MEM_TO_DEV, |
drivers/spi/spi-topcliff-pch.c
... | ... | @@ -1078,7 +1078,7 @@ |
1078 | 1078 | sg_dma_address(sg) = dma->rx_buf_dma + sg->offset; |
1079 | 1079 | } |
1080 | 1080 | sg = dma->sg_rx_p; |
1081 | - desc_rx = dma->chan_rx->device->device_prep_slave_sg(dma->chan_rx, sg, | |
1081 | + desc_rx = dmaengine_prep_slave_sg(dma->chan_rx, sg, | |
1082 | 1082 | num, DMA_DEV_TO_MEM, |
1083 | 1083 | DMA_PREP_INTERRUPT | DMA_CTRL_ACK); |
1084 | 1084 | if (!desc_rx) { |
... | ... | @@ -1123,7 +1123,7 @@ |
1123 | 1123 | sg_dma_address(sg) = dma->tx_buf_dma + sg->offset; |
1124 | 1124 | } |
1125 | 1125 | sg = dma->sg_tx_p; |
1126 | - desc_tx = dma->chan_tx->device->device_prep_slave_sg(dma->chan_tx, | |
1126 | + desc_tx = dmaengine_prep_slave_sg(dma->chan_tx, | |
1127 | 1127 | sg, num, DMA_MEM_TO_DEV, |
1128 | 1128 | DMA_PREP_INTERRUPT | DMA_CTRL_ACK); |
1129 | 1129 | if (!desc_tx) { |
drivers/tty/serial/amba-pl011.c
... | ... | @@ -483,7 +483,7 @@ |
483 | 483 | return -EBUSY; |
484 | 484 | } |
485 | 485 | |
486 | - desc = dma_dev->device_prep_slave_sg(chan, &dmatx->sg, 1, DMA_MEM_TO_DEV, | |
486 | + desc = dmaengine_prep_slave_sg(chan, &dmatx->sg, 1, DMA_MEM_TO_DEV, | |
487 | 487 | DMA_PREP_INTERRUPT | DMA_CTRL_ACK); |
488 | 488 | if (!desc) { |
489 | 489 | dma_unmap_sg(dma_dev->dev, &dmatx->sg, 1, DMA_TO_DEVICE); |
... | ... | @@ -666,7 +666,6 @@ |
666 | 666 | static int pl011_dma_rx_trigger_dma(struct uart_amba_port *uap) |
667 | 667 | { |
668 | 668 | struct dma_chan *rxchan = uap->dmarx.chan; |
669 | - struct dma_device *dma_dev; | |
670 | 669 | struct pl011_dmarx_data *dmarx = &uap->dmarx; |
671 | 670 | struct dma_async_tx_descriptor *desc; |
672 | 671 | struct pl011_sgbuf *sgbuf; |
... | ... | @@ -677,8 +676,7 @@ |
677 | 676 | /* Start the RX DMA job */ |
678 | 677 | sgbuf = uap->dmarx.use_buf_b ? |
679 | 678 | &uap->dmarx.sgbuf_b : &uap->dmarx.sgbuf_a; |
680 | - dma_dev = rxchan->device; | |
681 | - desc = rxchan->device->device_prep_slave_sg(rxchan, &sgbuf->sg, 1, | |
679 | + desc = dmaengine_prep_slave_sg(rxchan, &sgbuf->sg, 1, | |
682 | 680 | DMA_DEV_TO_MEM, |
683 | 681 | DMA_PREP_INTERRUPT | DMA_CTRL_ACK); |
684 | 682 | /* |
drivers/tty/serial/pch_uart.c
... | ... | @@ -763,7 +763,7 @@ |
763 | 763 | |
764 | 764 | sg_dma_address(sg) = priv->rx_buf_dma; |
765 | 765 | |
766 | - desc = priv->chan_rx->device->device_prep_slave_sg(priv->chan_rx, | |
766 | + desc = dmaengine_prep_slave_sg(priv->chan_rx, | |
767 | 767 | sg, 1, DMA_DEV_TO_MEM, |
768 | 768 | DMA_PREP_INTERRUPT | DMA_CTRL_ACK); |
769 | 769 | |
... | ... | @@ -922,7 +922,7 @@ |
922 | 922 | sg_dma_len(sg) = size; |
923 | 923 | } |
924 | 924 | |
925 | - desc = priv->chan_tx->device->device_prep_slave_sg(priv->chan_tx, | |
925 | + desc = dmaengine_prep_slave_sg(priv->chan_tx, | |
926 | 926 | priv->sg_tx_p, nent, DMA_MEM_TO_DEV, |
927 | 927 | DMA_PREP_INTERRUPT | DMA_CTRL_ACK); |
928 | 928 | if (!desc) { |
drivers/tty/serial/sh-sci.c
... | ... | @@ -1338,7 +1338,7 @@ |
1338 | 1338 | struct scatterlist *sg = &s->sg_rx[i]; |
1339 | 1339 | struct dma_async_tx_descriptor *desc; |
1340 | 1340 | |
1341 | - desc = chan->device->device_prep_slave_sg(chan, | |
1341 | + desc = dmaengine_prep_slave_sg(chan, | |
1342 | 1342 | sg, 1, DMA_DEV_TO_MEM, DMA_PREP_INTERRUPT); |
1343 | 1343 | |
1344 | 1344 | if (desc) { |
... | ... | @@ -1453,7 +1453,7 @@ |
1453 | 1453 | |
1454 | 1454 | BUG_ON(!sg_dma_len(sg)); |
1455 | 1455 | |
1456 | - desc = chan->device->device_prep_slave_sg(chan, | |
1456 | + desc = dmaengine_prep_slave_sg(chan, | |
1457 | 1457 | sg, s->sg_len_tx, DMA_MEM_TO_DEV, |
1458 | 1458 | DMA_PREP_INTERRUPT | DMA_CTRL_ACK); |
1459 | 1459 | if (!desc) { |
drivers/usb/musb/ux500_dma.c
... | ... | @@ -120,8 +120,7 @@ |
120 | 120 | dma_chan->device->device_control(dma_chan, DMA_SLAVE_CONFIG, |
121 | 121 | (unsigned long) &slave_conf); |
122 | 122 | |
123 | - dma_desc = dma_chan->device-> | |
124 | - device_prep_slave_sg(dma_chan, &sg, 1, direction, | |
123 | + dma_desc = dmaengine_prep_slave_sg(dma_chan, &sg, 1, direction, | |
125 | 124 | DMA_PREP_INTERRUPT | DMA_CTRL_ACK); |
126 | 125 | if (!dma_desc) |
127 | 126 | return false; |
drivers/usb/renesas_usbhs/fifo.c
... | ... | @@ -783,9 +783,8 @@ |
783 | 783 | sg_dma_address(&sg) = pkt->dma + pkt->actual; |
784 | 784 | sg_dma_len(&sg) = pkt->trans; |
785 | 785 | |
786 | - desc = chan->device->device_prep_slave_sg(chan, &sg, 1, dir, | |
787 | - DMA_PREP_INTERRUPT | | |
788 | - DMA_CTRL_ACK); | |
786 | + desc = dmaengine_prep_slave_sg(chan, &sg, 1, dir, | |
787 | + DMA_PREP_INTERRUPT | DMA_CTRL_ACK); | |
789 | 788 | if (!desc) |
790 | 789 | return; |
791 | 790 |
drivers/video/mx3fb.c
... | ... | @@ -337,7 +337,7 @@ |
337 | 337 | |
338 | 338 | /* This enables the channel */ |
339 | 339 | if (mx3_fbi->cookie < 0) { |
340 | - mx3_fbi->txd = dma_chan->device->device_prep_slave_sg(dma_chan, | |
340 | + mx3_fbi->txd = dmaengine_prep_slave_sg(dma_chan, | |
341 | 341 | &mx3_fbi->sg[0], 1, DMA_MEM_TO_DEV, DMA_PREP_INTERRUPT); |
342 | 342 | if (!mx3_fbi->txd) { |
343 | 343 | dev_err(mx3fb->dev, "Cannot allocate descriptor on %d\n", |
... | ... | @@ -1091,7 +1091,7 @@ |
1091 | 1091 | if (mx3_fbi->txd) |
1092 | 1092 | async_tx_ack(mx3_fbi->txd); |
1093 | 1093 | |
1094 | - txd = dma_chan->device->device_prep_slave_sg(dma_chan, sg + | |
1094 | + txd = dmaengine_prep_slave_sg(dma_chan, sg + | |
1095 | 1095 | mx3_fbi->cur_ipu_buf, 1, DMA_MEM_TO_DEV, DMA_PREP_INTERRUPT); |
1096 | 1096 | if (!txd) { |
1097 | 1097 | dev_err(fbi->device, |
include/linux/dmaengine.h
... | ... | @@ -622,6 +622,22 @@ |
622 | 622 | return chan->device->device_prep_slave_sg(chan, &sg, 1, dir, flags); |
623 | 623 | } |
624 | 624 | |
625 | +static inline struct dma_async_tx_descriptor *dmaengine_prep_slave_sg( | |
626 | + struct dma_chan *chan, struct scatterlist *sgl, unsigned int sg_len, | |
627 | + enum dma_transfer_direction dir, unsigned long flags) | |
628 | +{ | |
629 | + return chan->device->device_prep_slave_sg(chan, sgl, sg_len, | |
630 | + dir, flags); | |
631 | +} | |
632 | + | |
633 | +static inline struct dma_async_tx_descriptor *dmaengine_prep_dma_cyclic( | |
634 | + struct dma_chan *chan, dma_addr_t buf_addr, size_t buf_len, | |
635 | + size_t period_len, enum dma_transfer_direction dir) | |
636 | +{ | |
637 | + return chan->device->device_prep_dma_cyclic(chan, buf_addr, buf_len, | |
638 | + period_len, dir); | |
639 | +} | |
640 | + | |
625 | 641 | static inline int dmaengine_terminate_all(struct dma_chan *chan) |
626 | 642 | { |
627 | 643 | return dmaengine_device_control(chan, DMA_TERMINATE_ALL, 0); |
sound/soc/ep93xx/ep93xx-pcm.c
... | ... | @@ -142,11 +142,10 @@ |
142 | 142 | struct snd_pcm_runtime *runtime = substream->runtime; |
143 | 143 | struct ep93xx_runtime_data *rtd = runtime->private_data; |
144 | 144 | struct dma_chan *chan = rtd->dma_chan; |
145 | - struct dma_device *dma_dev = chan->device; | |
146 | 145 | struct dma_async_tx_descriptor *desc; |
147 | 146 | |
148 | 147 | rtd->pointer_bytes = 0; |
149 | - desc = dma_dev->device_prep_dma_cyclic(chan, runtime->dma_addr, | |
148 | + desc = dmaengine_prep_dma_cyclic(chan, runtime->dma_addr, | |
150 | 149 | rtd->period_bytes * rtd->periods, |
151 | 150 | rtd->period_bytes, |
152 | 151 | rtd->dma_data.direction); |
sound/soc/imx/imx-pcm-dma-mx2.c
... | ... | @@ -160,7 +160,7 @@ |
160 | 160 | |
161 | 161 | iprtd->buf = (unsigned int *)substream->dma_buffer.area; |
162 | 162 | |
163 | - iprtd->desc = chan->device->device_prep_dma_cyclic(chan, dma_addr, | |
163 | + iprtd->desc = dmaengine_prep_dma_cyclic(chan, dma_addr, | |
164 | 164 | iprtd->period_bytes * iprtd->periods, |
165 | 165 | iprtd->period_bytes, |
166 | 166 | substream->stream == SNDRV_PCM_STREAM_PLAYBACK ? |
sound/soc/mxs/mxs-pcm.c
... | ... | @@ -132,7 +132,7 @@ |
132 | 132 | |
133 | 133 | iprtd->buf = substream->dma_buffer.area; |
134 | 134 | |
135 | - iprtd->desc = chan->device->device_prep_dma_cyclic(chan, dma_addr, | |
135 | + iprtd->desc = dmaengine_prep_dma_cyclic(chan, dma_addr, | |
136 | 136 | iprtd->period_bytes * iprtd->periods, |
137 | 137 | iprtd->period_bytes, |
138 | 138 | substream->stream == SNDRV_PCM_STREAM_PLAYBACK ? |
sound/soc/sh/siu_pcm.c
... | ... | @@ -130,7 +130,7 @@ |
130 | 130 | sg_dma_len(&sg) = size; |
131 | 131 | sg_dma_address(&sg) = buff; |
132 | 132 | |
133 | - desc = siu_stream->chan->device->device_prep_slave_sg(siu_stream->chan, | |
133 | + desc = dmaengine_prep_slave_sg(siu_stream->chan, | |
134 | 134 | &sg, 1, DMA_MEM_TO_DEV, DMA_PREP_INTERRUPT | DMA_CTRL_ACK); |
135 | 135 | if (!desc) { |
136 | 136 | dev_err(dev, "Failed to allocate a dma descriptor\n"); |
... | ... | @@ -180,7 +180,7 @@ |
180 | 180 | sg_dma_len(&sg) = size; |
181 | 181 | sg_dma_address(&sg) = buff; |
182 | 182 | |
183 | - desc = siu_stream->chan->device->device_prep_slave_sg(siu_stream->chan, | |
183 | + desc = dmaengine_prep_slave_sg(siu_stream->chan, | |
184 | 184 | &sg, 1, DMA_DEV_TO_MEM, DMA_PREP_INTERRUPT | DMA_CTRL_ACK); |
185 | 185 | if (!desc) { |
186 | 186 | dev_err(dev, "Failed to allocate dma descriptor\n"); |
sound/soc/txx9/txx9aclc.c
... | ... | @@ -132,7 +132,7 @@ |
132 | 132 | sg_set_page(&sg, pfn_to_page(PFN_DOWN(buf_dma_addr)), |
133 | 133 | dmadata->frag_bytes, buf_dma_addr & (PAGE_SIZE - 1)); |
134 | 134 | sg_dma_address(&sg) = buf_dma_addr; |
135 | - desc = chan->device->device_prep_slave_sg(chan, &sg, 1, | |
135 | + desc = dmaengine_prep_slave_sg(chan, &sg, 1, | |
136 | 136 | dmadata->substream->stream == SNDRV_PCM_STREAM_PLAYBACK ? |
137 | 137 | DMA_MEM_TO_DEV : DMA_DEV_TO_MEM, |
138 | 138 | DMA_PREP_INTERRUPT | DMA_CTRL_ACK); |