summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2017-06-16 03:17:10 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-06-19 22:24:15 -0400
commit7b45fff006dd17ca7752e772bf9d347266e081b1 (patch)
tree153883ae2c00bbbffa8b7f9397a882dcd458448d
parente36361d70e9729ee2334fcb260014a3ff275c2e0 (diff)
serial/mpsc: switch to dma_alloc_attrs
Use dma_alloc_attrs directly instead of the dma_alloc_noncoherent wrapper. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/tty/serial/mpsc.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/tty/serial/mpsc.c b/drivers/tty/serial/mpsc.c
index 1a60a2063e75..67ffecc50e42 100644
--- a/drivers/tty/serial/mpsc.c
+++ b/drivers/tty/serial/mpsc.c
@@ -754,9 +754,10 @@ static int mpsc_alloc_ring_mem(struct mpsc_port_info *pi)
754 if (!dma_set_mask(pi->port.dev, 0xffffffff)) { 754 if (!dma_set_mask(pi->port.dev, 0xffffffff)) {
755 printk(KERN_ERR "MPSC: Inadequate DMA support\n"); 755 printk(KERN_ERR "MPSC: Inadequate DMA support\n");
756 rc = -ENXIO; 756 rc = -ENXIO;
757 } else if ((pi->dma_region = dma_alloc_noncoherent(pi->port.dev, 757 } else if ((pi->dma_region = dma_alloc_attrs(pi->port.dev,
758 MPSC_DMA_ALLOC_SIZE, 758 MPSC_DMA_ALLOC_SIZE,
759 &pi->dma_region_p, GFP_KERNEL)) 759 &pi->dma_region_p, GFP_KERNEL,
760 DMA_ATTR_NON_CONSISTENT))
760 == NULL) { 761 == NULL) {
761 printk(KERN_ERR "MPSC: Can't alloc Desc region\n"); 762 printk(KERN_ERR "MPSC: Can't alloc Desc region\n");
762 rc = -ENOMEM; 763 rc = -ENOMEM;
@@ -771,8 +772,9 @@ static void mpsc_free_ring_mem(struct mpsc_port_info *pi)
771 pr_debug("mpsc_free_ring_mem[%d]: Freeing ring mem\n", pi->port.line); 772 pr_debug("mpsc_free_ring_mem[%d]: Freeing ring mem\n", pi->port.line);
772 773
773 if (pi->dma_region) { 774 if (pi->dma_region) {
774 dma_free_noncoherent(pi->port.dev, MPSC_DMA_ALLOC_SIZE, 775 dma_free_attrs(pi->port.dev, MPSC_DMA_ALLOC_SIZE,
775 pi->dma_region, pi->dma_region_p); 776 pi->dma_region, pi->dma_region_p,
777 DMA_ATTR_NON_CONSISTENT);
776 pi->dma_region = NULL; 778 pi->dma_region = NULL;
777 pi->dma_region_p = (dma_addr_t)NULL; 779 pi->dma_region_p = (dma_addr_t)NULL;
778 } 780 }