diff options
author | Terje Bergstrom <tbergstrom@nvidia.com> | 2017-03-30 10:44:03 -0400 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2017-04-10 22:04:19 -0400 |
commit | 3ba374a5d94f8c2067731155afaf79f03e6c390c (patch) | |
tree | d8a2bd0d52b1e8862510aedeb7529944c0b7e28e /drivers/gpu/nvgpu/gk20a/regops_gk20a.c | |
parent | 2be51206af88aba6662cdd9de5bd6c18989bbcbd (diff) |
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 <tbergstrom@nvidia.com>
Reviewed-on: http://git-master/r/1331694
Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com>
Reviewed-by: Alex Waterman <alexw@nvidia.com>
GVS: Gerrit_Virtual_Submit
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/regops_gk20a.c')
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/regops_gk20a.c | 12 |
1 files changed, 5 insertions, 7 deletions
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 @@ | |||
25 | #include "dbg_gpu_gk20a.h" | 25 | #include "dbg_gpu_gk20a.h" |
26 | #include "regops_gk20a.h" | 26 | #include "regops_gk20a.h" |
27 | 27 | ||
28 | 28 | #include <nvgpu/log.h> | |
29 | 29 | ||
30 | static int regop_bsearch_range_cmp(const void *pkey, const void *pelem) | 30 | static int regop_bsearch_range_cmp(const void *pkey, const void *pelem) |
31 | { | 31 | { |
@@ -408,7 +408,7 @@ int exec_regops_gk20a(struct dbg_session_gk20a *dbg_s, | |||
408 | ops, num_ops); | 408 | ops, num_ops); |
409 | 409 | ||
410 | if (!ok) { | 410 | if (!ok) { |
411 | dev_err(dbg_s->dev, "invalid op(s)"); | 411 | nvgpu_err(g, "invalid op(s)"); |
412 | err = -EINVAL; | 412 | err = -EINVAL; |
413 | /* each op has its own err/status */ | 413 | /* each op has its own err/status */ |
414 | goto clean_up; | 414 | goto clean_up; |
@@ -527,7 +527,6 @@ static int validate_reg_op_info(struct dbg_session_gk20a *dbg_s, | |||
527 | break; | 527 | break; |
528 | default: | 528 | default: |
529 | op->status |= REGOP(STATUS_UNSUPPORTED_OP); | 529 | op->status |= REGOP(STATUS_UNSUPPORTED_OP); |
530 | /*gk20a_err(dbg_s->dev, "Invalid regops op %d!", op->op);*/ | ||
531 | err = -EINVAL; | 530 | err = -EINVAL; |
532 | break; | 531 | break; |
533 | } | 532 | } |
@@ -546,7 +545,6 @@ static int validate_reg_op_info(struct dbg_session_gk20a *dbg_s, | |||
546 | */ | 545 | */ |
547 | default: | 546 | default: |
548 | op->status |= REGOP(STATUS_INVALID_TYPE); | 547 | op->status |= REGOP(STATUS_INVALID_TYPE); |
549 | /*gk20a_err(dbg_s->dev, "Invalid regops type %d!", op->type);*/ | ||
550 | err = -EINVAL; | 548 | err = -EINVAL; |
551 | break; | 549 | break; |
552 | } | 550 | } |
@@ -593,7 +591,7 @@ static bool check_whitelists(struct dbg_session_gk20a *dbg_s, | |||
593 | } else if (op->type == REGOP(TYPE_GR_CTX)) { | 591 | } else if (op->type == REGOP(TYPE_GR_CTX)) { |
594 | /* it's a context-relative op */ | 592 | /* it's a context-relative op */ |
595 | if (!ch) { | 593 | if (!ch) { |
596 | gk20a_err(dbg_s->dev, "can't perform ctx regop unless bound"); | 594 | nvgpu_err(dbg_s->g, "can't perform ctx regop unless bound"); |
597 | op->status = REGOP(STATUS_UNSUPPORTED_OP); | 595 | op->status = REGOP(STATUS_UNSUPPORTED_OP); |
598 | return valid; | 596 | return valid; |
599 | } | 597 | } |
@@ -637,7 +635,7 @@ static int validate_reg_op_offset(struct dbg_session_gk20a *dbg_s, | |||
637 | 635 | ||
638 | /* support only 24-bit 4-byte aligned offsets */ | 636 | /* support only 24-bit 4-byte aligned offsets */ |
639 | if (offset & 0xFF000003) { | 637 | if (offset & 0xFF000003) { |
640 | gk20a_err(dbg_s->dev, "invalid regop offset: 0x%x\n", offset); | 638 | nvgpu_err(dbg_s->g, "invalid regop offset: 0x%x\n", offset); |
641 | op->status |= REGOP(STATUS_INVALID_OFFSET); | 639 | op->status |= REGOP(STATUS_INVALID_OFFSET); |
642 | return -EINVAL; | 640 | return -EINVAL; |
643 | } | 641 | } |
@@ -675,7 +673,7 @@ static int validate_reg_op_offset(struct dbg_session_gk20a *dbg_s, | |||
675 | } | 673 | } |
676 | 674 | ||
677 | if (!valid) { | 675 | if (!valid) { |
678 | gk20a_err(dbg_s->dev, "invalid regop offset: 0x%x\n", offset); | 676 | nvgpu_err(dbg_s->g, "invalid regop offset: 0x%x\n", offset); |
679 | op->status |= REGOP(STATUS_INVALID_OFFSET); | 677 | op->status |= REGOP(STATUS_INVALID_OFFSET); |
680 | return -EINVAL; | 678 | return -EINVAL; |
681 | } | 679 | } |