mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-22 09:12:24 +03:00
The original free routine has three options:
if (NVGPU_DMA_NO_KERNEL_MAPPING)
dma_free_attrs(d, mem->aligned_size, mem->priv.pages,
else if (other flags)
dma_free_attrs(d, mem->aligned_size, mem->cpu_va,
else /* No flags */
dma_free_coherent(d, mem->aligned_size, mem->cpu_va,
The last dma_free_coherent() can be unwrapped to dma_free_attrs
with its dma_attrs=0, while the former two are identical except
cpu_addr. So this patch merges these three into one single call
but differentiate the cpu_addr and dma_attrs parameters.
Note that the dma_free_attrs returns 0 when flags is not set.
Bug 200444660
Change-Id: I92ec0390138c79c5109973e476ea0ea719d4e2b9
Signed-off-by: Nicolin Chen <nicolinc@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2029679
GVS: Gerrit_Virtual_Submit
Reviewed-by: Alex Waterman <alexw@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
12 KiB
12 KiB