From 3ba374a5d94f8c2067731155afaf79f03e6c390c Mon Sep 17 00:00:00 2001 From: Terje Bergstrom Date: Thu, 30 Mar 2017 07:44:03 -0700 Subject: gpu: nvgpu: gk20a: Use new error macro gk20a_err() and gk20a_warn() require a struct device pointer, which is not portable across operating systems. The new nvgpu_err() and nvgpu_warn() macros take struct gk20a pointer. Convert code to use the more portable macros. JIRA NVGPU-16 Change-Id: Ia51f36d94c5ce57a5a0ab83b3c83a6bce09e2d5c Signed-off-by: Terje Bergstrom Reviewed-on: http://git-master/r/1331694 Reviewed-by: svccoveritychecker Reviewed-by: Alex Waterman GVS: Gerrit_Virtual_Submit --- drivers/gpu/nvgpu/gk20a/regops_gk20a.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'drivers/gpu/nvgpu/gk20a/regops_gk20a.c') diff --git a/drivers/gpu/nvgpu/gk20a/regops_gk20a.c b/drivers/gpu/nvgpu/gk20a/regops_gk20a.c index 9fa7514a..b19b16d7 100644 --- a/drivers/gpu/nvgpu/gk20a/regops_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/regops_gk20a.c @@ -25,7 +25,7 @@ #include "dbg_gpu_gk20a.h" #include "regops_gk20a.h" - +#include static int regop_bsearch_range_cmp(const void *pkey, const void *pelem) { @@ -408,7 +408,7 @@ int exec_regops_gk20a(struct dbg_session_gk20a *dbg_s, ops, num_ops); if (!ok) { - dev_err(dbg_s->dev, "invalid op(s)"); + nvgpu_err(g, "invalid op(s)"); err = -EINVAL; /* each op has its own err/status */ goto clean_up; @@ -527,7 +527,6 @@ static int validate_reg_op_info(struct dbg_session_gk20a *dbg_s, break; default: op->status |= REGOP(STATUS_UNSUPPORTED_OP); - /*gk20a_err(dbg_s->dev, "Invalid regops op %d!", op->op);*/ err = -EINVAL; break; } @@ -546,7 +545,6 @@ static int validate_reg_op_info(struct dbg_session_gk20a *dbg_s, */ default: op->status |= REGOP(STATUS_INVALID_TYPE); - /*gk20a_err(dbg_s->dev, "Invalid regops type %d!", op->type);*/ err = -EINVAL; break; } @@ -593,7 +591,7 @@ static bool check_whitelists(struct dbg_session_gk20a *dbg_s, } else if (op->type == REGOP(TYPE_GR_CTX)) { /* it's a context-relative op */ if (!ch) { - gk20a_err(dbg_s->dev, "can't perform ctx regop unless bound"); + nvgpu_err(dbg_s->g, "can't perform ctx regop unless bound"); op->status = REGOP(STATUS_UNSUPPORTED_OP); return valid; } @@ -637,7 +635,7 @@ static int validate_reg_op_offset(struct dbg_session_gk20a *dbg_s, /* support only 24-bit 4-byte aligned offsets */ if (offset & 0xFF000003) { - gk20a_err(dbg_s->dev, "invalid regop offset: 0x%x\n", offset); + nvgpu_err(dbg_s->g, "invalid regop offset: 0x%x\n", offset); op->status |= REGOP(STATUS_INVALID_OFFSET); return -EINVAL; } @@ -675,7 +673,7 @@ static int validate_reg_op_offset(struct dbg_session_gk20a *dbg_s, } if (!valid) { - gk20a_err(dbg_s->dev, "invalid regop offset: 0x%x\n", offset); + nvgpu_err(dbg_s->g, "invalid regop offset: 0x%x\n", offset); op->status |= REGOP(STATUS_INVALID_OFFSET); return -EINVAL; } -- cgit v1.2.2