From 3ab4a992e10cd0a312a865a4937b90162978356c Mon Sep 17 00:00:00 2001 From: Alex Waterman Date: Wed, 8 Mar 2017 16:58:49 -0800 Subject: gpu: nvgpu: Use new kmem API functions (gp10b/*) Use the new kmem API functions in gp10b/*. Bug 1799159 Bug 1823380 Change-Id: Ia643c704aca2e23e3762c9b7dbdf1aa1f2363811 Signed-off-by: Alex Waterman Reviewed-on: http://git-master/r/1318309 Reviewed-by: svccoveritychecker GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom --- .../gpu/nvgpu/tegra/linux/platform_gp10b_tegra.c | 23 ++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) (limited to 'drivers/gpu/nvgpu/tegra/linux/platform_gp10b_tegra.c') diff --git a/drivers/gpu/nvgpu/tegra/linux/platform_gp10b_tegra.c b/drivers/gpu/nvgpu/tegra/linux/platform_gp10b_tegra.c index 27db9c12..8e8792f6 100644 --- a/drivers/gpu/nvgpu/tegra/linux/platform_gp10b_tegra.c +++ b/drivers/gpu/nvgpu/tegra/linux/platform_gp10b_tegra.c @@ -16,18 +16,19 @@ #include #include #include -#include #include #include #include #include #include - #include #include #include +#include + +#include #include "clk.h" @@ -540,11 +541,13 @@ static int ecc_stat_create(struct device *dev, num_hw_units = g->gr.tpc_count; /* Allocate arrays */ - dev_attr_array = kzalloc(sizeof(struct device_attribute) * num_hw_units, GFP_KERNEL); - ecc_stat->counters = kzalloc(sizeof(u32) * num_hw_units, GFP_KERNEL); - ecc_stat->names = kzalloc(sizeof(char *) * num_hw_units, GFP_KERNEL); + dev_attr_array = nvgpu_kzalloc(g, sizeof(struct device_attribute) * + num_hw_units); + ecc_stat->counters = nvgpu_kzalloc(g, sizeof(u32) * num_hw_units); + ecc_stat->names = nvgpu_kzalloc(g, sizeof(char *) * num_hw_units); for (hw_unit = 0; hw_unit < num_hw_units; hw_unit++) { - ecc_stat->names[hw_unit] = kzalloc(sizeof(char) * ECC_STAT_NAME_MAX_SIZE, GFP_KERNEL); + ecc_stat->names[hw_unit] = nvgpu_kzalloc(g, sizeof(char) * + ECC_STAT_NAME_MAX_SIZE); } for (hw_unit = 0; hw_unit < num_hw_units; hw_unit++) { @@ -604,12 +607,12 @@ static void ecc_stat_remove(struct device *dev, hash_del(&ecc_stat->hash_node); /* Free arrays */ - kfree(ecc_stat->counters); + nvgpu_kfree(g, ecc_stat->counters); for (hw_unit = 0; hw_unit < num_hw_units; hw_unit++) { - kfree(ecc_stat->names[hw_unit]); + nvgpu_kfree(g, ecc_stat->names[hw_unit]); } - kfree(ecc_stat->names); - kfree(dev_attr_array); + nvgpu_kfree(g, ecc_stat->names); + nvgpu_kfree(g, dev_attr_array); } void gr_gp10b_create_sysfs(struct device *dev) -- cgit v1.2.2