Commit 0de4df5b authored by Srinivas Kandagatla's avatar Srinivas Kandagatla Committed by Kalle Valo

ath10k: use dma_zalloc_coherent()

use dma_zalloc_coherent() instead of dma_alloc_coherent and memset().
Signed-off-by: default avatarSrinivas Kandagatla <srinivas.kandagatla@linaro.org>
Signed-off-by: default avatarKalle Valo <kvalo@qca.qualcomm.com>
parent dd51fa3d
...@@ -958,7 +958,7 @@ ath10k_ce_alloc_dest_ring(struct ath10k *ar, unsigned int ce_id, ...@@ -958,7 +958,7 @@ ath10k_ce_alloc_dest_ring(struct ath10k *ar, unsigned int ce_id,
* coherent DMA are unsupported * coherent DMA are unsupported
*/ */
dest_ring->base_addr_owner_space_unaligned = dest_ring->base_addr_owner_space_unaligned =
dma_alloc_coherent(ar->dev, dma_zalloc_coherent(ar->dev,
(nentries * sizeof(struct ce_desc) + (nentries * sizeof(struct ce_desc) +
CE_DESC_RING_ALIGN), CE_DESC_RING_ALIGN),
&base_addr, GFP_KERNEL); &base_addr, GFP_KERNEL);
...@@ -969,13 +969,6 @@ ath10k_ce_alloc_dest_ring(struct ath10k *ar, unsigned int ce_id, ...@@ -969,13 +969,6 @@ ath10k_ce_alloc_dest_ring(struct ath10k *ar, unsigned int ce_id,
dest_ring->base_addr_ce_space_unaligned = base_addr; dest_ring->base_addr_ce_space_unaligned = base_addr;
/*
* Correctly initialize memory to 0 to prevent garbage
* data crashing system when download firmware
*/
memset(dest_ring->base_addr_owner_space_unaligned, 0,
nentries * sizeof(struct ce_desc) + CE_DESC_RING_ALIGN);
dest_ring->base_addr_owner_space = PTR_ALIGN( dest_ring->base_addr_owner_space = PTR_ALIGN(
dest_ring->base_addr_owner_space_unaligned, dest_ring->base_addr_owner_space_unaligned,
CE_DESC_RING_ALIGN); CE_DESC_RING_ALIGN);
......
...@@ -896,7 +896,7 @@ static int ath10k_pci_diag_read_mem(struct ath10k *ar, u32 address, void *data, ...@@ -896,7 +896,7 @@ static int ath10k_pci_diag_read_mem(struct ath10k *ar, u32 address, void *data,
*/ */
alloc_nbytes = min_t(unsigned int, nbytes, DIAG_TRANSFER_LIMIT); alloc_nbytes = min_t(unsigned int, nbytes, DIAG_TRANSFER_LIMIT);
data_buf = (unsigned char *)dma_alloc_coherent(ar->dev, data_buf = (unsigned char *)dma_zalloc_coherent(ar->dev,
alloc_nbytes, alloc_nbytes,
&ce_data_base, &ce_data_base,
GFP_ATOMIC); GFP_ATOMIC);
...@@ -905,7 +905,6 @@ static int ath10k_pci_diag_read_mem(struct ath10k *ar, u32 address, void *data, ...@@ -905,7 +905,6 @@ static int ath10k_pci_diag_read_mem(struct ath10k *ar, u32 address, void *data,
ret = -ENOMEM; ret = -ENOMEM;
goto done; goto done;
} }
memset(data_buf, 0, alloc_nbytes);
remaining_bytes = nbytes; remaining_bytes = nbytes;
ce_data = ce_data_base; ce_data = ce_data_base;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment