diff --git a/drivers/gpu/nvgpu/common/linux/dma.c b/drivers/gpu/nvgpu/common/linux/dma.c index d0b6c8a8b..786065ddb 100644 --- a/drivers/gpu/nvgpu/common/linux/dma.c +++ b/drivers/gpu/nvgpu/common/linux/dma.c @@ -634,7 +634,11 @@ void nvgpu_free_sgtable(struct gk20a *g, struct sg_table **sgt) bool nvgpu_iommuable(struct gk20a *g) { +#ifdef CONFIG_TEGRA_GK20A struct nvgpu_os_linux *l = nvgpu_os_linux_from_gk20a(g); return device_is_iommuable(l->dev); +#else + return true; +#endif } diff --git a/drivers/gpu/nvgpu/common/linux/nvgpu_mem.c b/drivers/gpu/nvgpu/common/linux/nvgpu_mem.c index eb64ecd3f..79098eca1 100644 --- a/drivers/gpu/nvgpu/common/linux/nvgpu_mem.c +++ b/drivers/gpu/nvgpu/common/linux/nvgpu_mem.c @@ -313,9 +313,7 @@ void nvgpu_memset(struct gk20a *g, struct nvgpu_mem *mem, u32 offset, */ u64 nvgpu_mem_get_addr_sgl(struct gk20a *g, struct scatterlist *sgl) { - struct nvgpu_os_linux *l = container_of(g, struct nvgpu_os_linux, g); - - if (!device_is_iommuable(l->dev)) + if (!nvgpu_iommuable(g)) return g->ops.mm.gpu_phys_addr(g, NULL, sg_phys(sgl)); if (sg_dma_address(sgl) == 0)