From e5c3b05bb2775236679b74194e4ac24612ef39b6 Mon Sep 17 00:00:00 2001 From: Deepak Nibade Date: Mon, 30 Oct 2017 19:28:43 +0530 Subject: gpu: nvgpu: use struct gk20a for create_gr_sysfs API gr_gv11b_create_sysfs() and GR HAL create_gr_sysfs() right now receive linux specific struct device But since this function is called from/declared in common code, we need to remove linux dependency from it Hence update the API and GR HAL to receive struct gk20a pointer instead of device pointer Jira NVGPU-259 Change-Id: I65d717ad9f263f0397f8efa5761c64e55c7846eb Signed-off-by: Deepak Nibade Reviewed-on: https://git-master.nvidia.com/r/1588465 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Terje Bergstrom GVS: Gerrit_Virtual_Submit Reviewed-by: Bharat Nihalani Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c') diff --git a/drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c b/drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c index d2c690f4..5308f4ea 100644 --- a/drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c +++ b/drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c @@ -40,6 +40,7 @@ #include "gp10b/platform_gp10b.h" #include "common/linux/platform_gp10b_tegra.h" +#include "common/linux/os_linux.h" #include "common/linux/platform_gk20a_tegra.h" #include "gr_gv11b.h" #include "nvgpu_gpuid_t19x.h" @@ -188,9 +189,9 @@ static struct device_attribute *dev_attr_mmu_hubtlb_ecc_uncorrected_err_count_ar static struct device_attribute *dev_attr_mmu_fillunit_ecc_corrected_err_count_array; static struct device_attribute *dev_attr_mmu_fillunit_ecc_uncorrected_err_count_array; -void gr_gv11b_create_sysfs(struct device *dev) +void gr_gv11b_create_sysfs(struct gk20a *g) { - struct gk20a *g = get_gk20a(dev); + struct device *dev = dev_from_gk20a(g); int error = 0; /* This stat creation function is called on GR init. GR can get initialized multiple times but we only need to create the ECC @@ -199,7 +200,7 @@ void gr_gv11b_create_sysfs(struct device *dev) if (g->ecc.gr.t19x.sm_l1_tag_corrected_err_count.counters != NULL) return; - gr_gp10b_create_sysfs(dev); + gr_gp10b_create_sysfs(g); error |= gr_gp10b_ecc_stat_create(dev, 0, -- cgit v1.2.2