From c11228d48be1825e1ec84afd38c6938504fa4100 Mon Sep 17 00:00:00 2001 From: Alex Waterman Date: Wed, 8 Mar 2017 16:51:33 -0800 Subject: gpu: nvgpu: Use new kmem API functions (common/*) Use the new kmem API functions in common/* and common/mm/*. Add a struct gk20a pointer to struct nvgpu_allocator in order to store the gk20a pointer used for allocating memory. Bug 1799159 Bug 1823380 Change-Id: I881ea9545e8a8f0b75d77a1e35dd1812e0bb654e Signed-off-by: Alex Waterman Reviewed-on: http://git-master/r/1318315 Reviewed-by: svccoveritychecker GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom --- drivers/gpu/nvgpu/common/nvgpu_common.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'drivers/gpu/nvgpu/common/nvgpu_common.c') diff --git a/drivers/gpu/nvgpu/common/nvgpu_common.c b/drivers/gpu/nvgpu/common/nvgpu_common.c index d7ff4841..771d4121 100644 --- a/drivers/gpu/nvgpu/common/nvgpu_common.c +++ b/drivers/gpu/nvgpu/common/nvgpu_common.c @@ -17,11 +17,12 @@ #include #include +#include +#include + #include "gk20a/gk20a_scale.h" #include "gk20a/gk20a.h" -#include - #define EMC3D_DEFAULT_RATIO 750 static void nvgpu_init_vars(struct gk20a *g) @@ -164,7 +165,7 @@ int nvgpu_probe(struct gk20a *g, gk20a_create_sysfs(g->dev); gk20a_debug_init(g->dev, debugfs_symlink); - g->dbg_regops_tmp_buf = kzalloc(SZ_4K, GFP_KERNEL); + g->dbg_regops_tmp_buf = nvgpu_kzalloc(g, SZ_4K); if (!g->dbg_regops_tmp_buf) { dev_err(g->dev, "couldn't allocate regops tmp buf"); return -ENOMEM; @@ -190,7 +191,8 @@ static const struct firmware *do_request_firmware(struct device *dev, path_len = strlen(prefix) + strlen(fw_name); path_len += 2; /* for the path separator and zero terminator*/ - fw_path = kzalloc(sizeof(*fw_path) * path_len, GFP_KERNEL); + fw_path = nvgpu_kzalloc(get_gk20a(dev), + sizeof(*fw_path) * path_len); if (!fw_path) return NULL; @@ -207,7 +209,7 @@ static const struct firmware *do_request_firmware(struct device *dev, err = request_firmware(&fw, fw_name, dev); #endif - kfree(fw_path); + nvgpu_kfree(get_gk20a(dev), fw_path); if (err) return NULL; return fw; -- cgit v1.2.2