]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
serial/mpsc: switch to dma_alloc_attrs
authorChristoph Hellwig <hch@lst.de>
Fri, 16 Jun 2017 07:17:10 +0000 (09:17 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 20 Jun 2017 02:24:15 +0000 (10:24 +0800)
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>
drivers/tty/serial/mpsc.c

index 1a60a2063e758f46dee89380d99e84bf4f3e78b6..67ffecc50e427a3dae944911fe51efdb5213f7a7 100644 (file)
@@ -754,9 +754,10 @@ static int mpsc_alloc_ring_mem(struct mpsc_port_info *pi)
                if (!dma_set_mask(pi->port.dev, 0xffffffff)) {
                        printk(KERN_ERR "MPSC: Inadequate DMA support\n");
                        rc = -ENXIO;
-               } else if ((pi->dma_region = dma_alloc_noncoherent(pi->port.dev,
+               } else if ((pi->dma_region = dma_alloc_attrs(pi->port.dev,
                                                MPSC_DMA_ALLOC_SIZE,
-                                               &pi->dma_region_p, GFP_KERNEL))
+                                               &pi->dma_region_p, GFP_KERNEL,
+                                               DMA_ATTR_NON_CONSISTENT))
                                == NULL) {
                        printk(KERN_ERR "MPSC: Can't alloc Desc region\n");
                        rc = -ENOMEM;
@@ -771,8 +772,9 @@ static void mpsc_free_ring_mem(struct mpsc_port_info *pi)
        pr_debug("mpsc_free_ring_mem[%d]: Freeing ring mem\n", pi->port.line);
 
        if (pi->dma_region) {
-               dma_free_noncoherent(pi->port.dev, MPSC_DMA_ALLOC_SIZE,
-                               pi->dma_region, pi->dma_region_p);
+               dma_free_attrs(pi->port.dev, MPSC_DMA_ALLOC_SIZE,
+                               pi->dma_region, pi->dma_region_p,
+                               DMA_ATTR_NON_CONSISTENT);
                pi->dma_region = NULL;
                pi->dma_region_p = (dma_addr_t)NULL;
        }