tegra: hwpm: Fix build for Linux v5.18

Upstream commit 7938f4218168 ("dma-buf-map: Rename to iosys-map")
renames 'struct dma_buf_map' to 'struct iosys_map' and this causes the
HWPM driver build to fail for Linux v5.18 and greater. Fix this by using
the appropriate structure name depending on kernel version.

Bug 3767126

Change-Id: I2f2b3839b27e3ac665180f45c811ffbef82199cc
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2778803
Tested-by: Rohit Khanna <rokhanna@nvidia.com>
Reviewed-by: Vedashree Vidwans <vvidwans@nvidia.com>
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: Seema Khowala <seemaj@nvidia.com>
Reviewed-by: Rohit Khanna <rokhanna@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
This commit is contained in:
Jon Hunter
2022-09-20 11:51:10 +01:00
committed by mobile promotions
parent 4cacfb709c
commit ef085231d2

View File

@@ -19,6 +19,7 @@
#include <linux/string.h>
#include <linux/of_address.h>
#include <linux/dma-buf.h>
#include <linux/version.h>
#include <uapi/linux/tegra-soc-hwpm-uapi.h>
#include <tegra_hwpm_kmem.h>
@@ -128,7 +129,11 @@ static int tegra_hwpm_dma_map_mem_bytes_buffer(struct tegra_soc_hwpm *hwpm,
#if defined(CONFIG_TEGRA_HWPM_OOT)
err = dma_buf_vmap(hwpm->mem_mgmt->mem_bytes_dma_buf,
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 18, 0)
(struct iosys_map *)hwpm->mem_mgmt->mem_bytes_kernel);
#else
(struct dma_buf_map *)hwpm->mem_mgmt->mem_bytes_kernel);
#endif
if (err != 0) {
tegra_hwpm_err(hwpm,
"Unable to map mem_bytes buffer into kernel VA space");