diff options
author | Pritesh Raithatha <praithatha@nvidia.com> | 2018-07-10 03:21:43 -0400 |
---|---|---|
committer | Rakesh Babu Bodla <rbodla@nvidia.com> | 2018-07-12 07:06:01 -0400 |
commit | dccb63896018b7ce6a80d391b538e815f5a4719b (patch) | |
tree | 7fc5bdae2ca9d9a3a1f858bab774b2040ff04378 | |
parent | 4afa3e71bd9510b1acedb6aa810a81ae0c96c24d (diff) |
video: tegra: nvmap: fix return value check of dma_declare_coherent_memory
Kernel-4.9 and before dma_declare_coherent_memory function was not reporting
failure. We updated the code to return the same mapping flag(MAP/NOMAP/IO)
in case of succeed.
Kernel-4.14 upstream is updated to return error in case of failure so
updating return value check in nvmap heap.
Bug 200415588
Change-Id: I4222438a80516d9c78f7cd9d4325a00cccb463df
Signed-off-by: Pritesh Raithatha <praithatha@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1774909
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: Krishna Reddy <vdumpa@nvidia.com>
Reviewed-by: David Gilhooley <dgilhooley@nvidia.com>
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
-rw-r--r-- | drivers/video/tegra/nvmap/nvmap_heap.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/video/tegra/nvmap/nvmap_heap.c b/drivers/video/tegra/nvmap/nvmap_heap.c index 19b9f273f..5c1c44951 100644 --- a/drivers/video/tegra/nvmap/nvmap_heap.c +++ b/drivers/video/tegra/nvmap/nvmap_heap.c | |||
@@ -422,7 +422,11 @@ struct nvmap_heap *nvmap_heap_create(struct device *parent, | |||
422 | /* declare Non-CMA heap */ | 422 | /* declare Non-CMA heap */ |
423 | err = dma_declare_coherent_memory(h->dma_dev, 0, base, len, | 423 | err = dma_declare_coherent_memory(h->dma_dev, 0, base, len, |
424 | DMA_MEMORY_NOMAP | DMA_MEMORY_EXCLUSIVE); | 424 | DMA_MEMORY_NOMAP | DMA_MEMORY_EXCLUSIVE); |
425 | #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 14, 0) | ||
426 | if (!err) { | ||
427 | #else | ||
425 | if (err & DMA_MEMORY_NOMAP) { | 428 | if (err & DMA_MEMORY_NOMAP) { |
429 | #endif | ||
426 | dev_info(parent, | 430 | dev_info(parent, |
427 | "%s :dma coherent mem declare %pa,%zu\n", | 431 | "%s :dma coherent mem declare %pa,%zu\n", |
428 | co->name, &base, len); | 432 | co->name, &base, len); |