]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
rt2x00: Use dma_zalloc_coherent
authorJoe Perches <joe@perches.com>
Sun, 15 Jun 2014 20:37:43 +0000 (13:37 -0700)
committerJohn W. Linville <linville@tuxdriver.com>
Thu, 19 Jun 2014 19:49:21 +0000 (15:49 -0400)
Use the zeroing function instead of dma_alloc_coherent & memset(,0,)

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/rt2x00/rt2x00mmio.c

index 6f236ea180aa3df23dbf8be831f367c020f4a1a2..f0178fd4fe5ff8c078749e6df8b82d1ea7a26a0c 100644 (file)
@@ -119,14 +119,12 @@ static int rt2x00mmio_alloc_queue_dma(struct rt2x00_dev *rt2x00dev,
        /*
         * Allocate DMA memory for descriptor and buffer.
         */
-       addr = dma_alloc_coherent(rt2x00dev->dev,
-                                 queue->limit * queue->desc_size,
-                                 &dma, GFP_KERNEL);
+       addr = dma_zalloc_coherent(rt2x00dev->dev,
+                                  queue->limit * queue->desc_size, &dma,
+                                  GFP_KERNEL);
        if (!addr)
                return -ENOMEM;
 
-       memset(addr, 0, queue->limit * queue->desc_size);
-
        /*
         * Initialize all queue entries to contain valid addresses.
         */