From ef085231d21d065b81682070f66fa3ffd12a5022 Mon Sep 17 00:00:00 2001 From: Jon Hunter Date: Tue, 20 Sep 2022 11:51:10 +0100 Subject: [PATCH] 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 Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2778803 Tested-by: Rohit Khanna Reviewed-by: Vedashree Vidwans Reviewed-by: svc-mobile-coverity Reviewed-by: Seema Khowala Reviewed-by: Rohit Khanna GVS: Gerrit_Virtual_Submit --- os/linux/mem_mgmt_utils.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/os/linux/mem_mgmt_utils.c b/os/linux/mem_mgmt_utils.c index 42e725b..f8c896f 100644 --- a/os/linux/mem_mgmt_utils.c +++ b/os/linux/mem_mgmt_utils.c @@ -19,6 +19,7 @@ #include #include #include +#include #include #include @@ -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");