diff options
author | Terje Bergstrom <tbergstrom@nvidia.com> | 2017-04-06 15:56:41 -0400 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2017-04-10 15:24:22 -0400 |
commit | 54eb74539342ce0fa6961e46f2ce22b68ad2fb21 (patch) | |
tree | 0de41f6b86a1b44f91db1361fcb68acec4056d99 /drivers/gpu/nvgpu/pmgr/pwrpolicy.c | |
parent | bc4a0bd0acd1d9b09f753d97383caa542cbb728a (diff) |
gpu: nvgpu: pmgr: Use new error macros
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: I8d85e4d3da1fe8f99649ef4395a5b0dc52b0caf2
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: http://git-master/r/1457353
Reviewed-by: Alex Waterman <alexw@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/pmgr/pwrpolicy.c')
-rw-r--r-- | drivers/gpu/nvgpu/pmgr/pwrpolicy.c | 28 |
1 files changed, 13 insertions, 15 deletions
diff --git a/drivers/gpu/nvgpu/pmgr/pwrpolicy.c b/drivers/gpu/nvgpu/pmgr/pwrpolicy.c index c2053469..e9329438 100644 --- a/drivers/gpu/nvgpu/pmgr/pwrpolicy.c +++ b/drivers/gpu/nvgpu/pmgr/pwrpolicy.c | |||
@@ -53,7 +53,7 @@ static u32 _pwr_policy_limitarbinputset_helper(struct gk20a *g, | |||
53 | p_limit_arb->num_inputs].limit_value = limit_value; | 53 | p_limit_arb->num_inputs].limit_value = limit_value; |
54 | p_limit_arb->num_inputs++; | 54 | p_limit_arb->num_inputs++; |
55 | } else { | 55 | } else { |
56 | gk20a_err(g->dev, "No entries remaining for clientIdx=%d", | 56 | nvgpu_err(g, "No entries remaining for clientIdx=%d", |
57 | client_idx); | 57 | client_idx); |
58 | status = -EINVAL; | 58 | status = -EINVAL; |
59 | } | 59 | } |
@@ -100,7 +100,7 @@ static u32 _pwr_policy_limitid_translate(struct gk20a *g, | |||
100 | break; | 100 | break; |
101 | 101 | ||
102 | default: | 102 | default: |
103 | gk20a_err(g->dev, "Unsupported limitId=%d", | 103 | nvgpu_err(g, "Unsupported limitId=%d", |
104 | limit_id); | 104 | limit_id); |
105 | status = -EINVAL; | 105 | status = -EINVAL; |
106 | break; | 106 | break; |
@@ -130,7 +130,7 @@ static u32 _pwr_policy_limitarbinputset(struct gk20a *g, | |||
130 | 130 | ||
131 | status = _pwr_policy_limitarbinputset_helper(g, p_limit_arb, client_idx, limit); | 131 | status = _pwr_policy_limitarbinputset_helper(g, p_limit_arb, client_idx, limit); |
132 | if (status) { | 132 | if (status) { |
133 | gk20a_err(g->dev, | 133 | nvgpu_err(g, |
134 | "Error setting client limit value: status=0x%08x, limitId=0x%x, clientIdx=0x%x, limit=%d", | 134 | "Error setting client limit value: status=0x%08x, limitId=0x%x, clientIdx=0x%x, limit=%d", |
135 | status, limit_id, client_idx, limit); | 135 | status, limit_id, client_idx, limit); |
136 | goto exit; | 136 | goto exit; |
@@ -185,7 +185,7 @@ static u32 _pwr_domains_pmudatainit_hw_threshold(struct gk20a *g, | |||
185 | 185 | ||
186 | status = boardobj_pmudatainit_super(g, board_obj_ptr, ppmudata); | 186 | status = boardobj_pmudatainit_super(g, board_obj_ptr, ppmudata); |
187 | if (status) { | 187 | if (status) { |
188 | gk20a_err(dev_from_gk20a(g), | 188 | nvgpu_err(g, |
189 | "error updating pmu boardobjgrp for pwr sensor 0x%x", | 189 | "error updating pmu boardobjgrp for pwr sensor 0x%x", |
190 | status); | 190 | status); |
191 | status = -ENOMEM; | 191 | status = -ENOMEM; |
@@ -294,8 +294,7 @@ static struct boardobj *construct_pwr_policy(struct gk20a *g, | |||
294 | break; | 294 | break; |
295 | 295 | ||
296 | default: | 296 | default: |
297 | gk20a_err(g->dev, | 297 | nvgpu_err(g, "Error: unrecognized Power Policy filter type: %d", |
298 | "Error: unrecognized Power Policy filter type: %d.\n", | ||
299 | pwrpolicy->filter_type); | 298 | pwrpolicy->filter_type); |
300 | } | 299 | } |
301 | 300 | ||
@@ -385,7 +384,7 @@ static u32 _pwr_policy_construct_WAR_SW_Threshold_policy(struct gk20a *g, | |||
385 | pwr_policy_size, ppwrpolicydata->boardobj.type); | 384 | pwr_policy_size, ppwrpolicydata->boardobj.type); |
386 | 385 | ||
387 | if (!boardobj) { | 386 | if (!boardobj) { |
388 | gk20a_err(dev_from_gk20a(g), | 387 | nvgpu_err(g, |
389 | "unable to create pwr policy for type %d", ppwrpolicydata->boardobj.type); | 388 | "unable to create pwr policy for type %d", ppwrpolicydata->boardobj.type); |
390 | status = -EINVAL; | 389 | status = -EINVAL; |
391 | goto done; | 390 | goto done; |
@@ -395,7 +394,7 @@ static u32 _pwr_policy_construct_WAR_SW_Threshold_policy(struct gk20a *g, | |||
395 | boardobj, obj_index); | 394 | boardobj, obj_index); |
396 | 395 | ||
397 | if (status) { | 396 | if (status) { |
398 | gk20a_err(dev_from_gk20a(g), | 397 | nvgpu_err(g, |
399 | "unable to insert pwr policy boardobj for %d", obj_index); | 398 | "unable to insert pwr policy boardobj for %d", obj_index); |
400 | status = -EINVAL; | 399 | status = -EINVAL; |
401 | goto done; | 400 | goto done; |
@@ -659,7 +658,7 @@ static u32 devinit_get_pwr_policy_table(struct gk20a *g, | |||
659 | pwr_policy_size, pwr_policy_data.boardobj.type); | 658 | pwr_policy_size, pwr_policy_data.boardobj.type); |
660 | 659 | ||
661 | if (!boardobj) { | 660 | if (!boardobj) { |
662 | gk20a_err(dev_from_gk20a(g), | 661 | nvgpu_err(g, |
663 | "unable to create pwr policy for %d type %d", | 662 | "unable to create pwr policy for %d type %d", |
664 | index, pwr_policy_data.boardobj.type); | 663 | index, pwr_policy_data.boardobj.type); |
665 | status = -EINVAL; | 664 | status = -EINVAL; |
@@ -670,7 +669,7 @@ static u32 devinit_get_pwr_policy_table(struct gk20a *g, | |||
670 | boardobj, obj_index); | 669 | boardobj, obj_index); |
671 | 670 | ||
672 | if (status) { | 671 | if (status) { |
673 | gk20a_err(dev_from_gk20a(g), | 672 | nvgpu_err(g, |
674 | "unable to insert pwr policy boardobj for %d", | 673 | "unable to insert pwr policy boardobj for %d", |
675 | index); | 674 | index); |
676 | status = -EINVAL; | 675 | status = -EINVAL; |
@@ -687,8 +686,7 @@ static u32 devinit_get_pwr_policy_table(struct gk20a *g, | |||
687 | sizeof(struct pwr_policy_sw_threshold), | 686 | sizeof(struct pwr_policy_sw_threshold), |
688 | obj_index); | 687 | obj_index); |
689 | if (status) { | 688 | if (status) { |
690 | gk20a_err(dev_from_gk20a(g), | 689 | nvgpu_err(g, "unable to construct_WAR_policy"); |
691 | "unable to construct_WAR_policy"); | ||
692 | status = -EINVAL; | 690 | status = -EINVAL; |
693 | goto done; | 691 | goto done; |
694 | } | 692 | } |
@@ -712,7 +710,7 @@ u32 pmgr_policy_sw_setup(struct gk20a *g) | |||
712 | status = boardobjgrpconstruct_e32( | 710 | status = boardobjgrpconstruct_e32( |
713 | &g->pmgr_pmu.pmgr_policyobjs.pwr_policies); | 711 | &g->pmgr_pmu.pmgr_policyobjs.pwr_policies); |
714 | if (status) { | 712 | if (status) { |
715 | gk20a_err(dev_from_gk20a(g), | 713 | nvgpu_err(g, |
716 | "error creating boardobjgrp for pmgr policy, status - 0x%x", | 714 | "error creating boardobjgrp for pmgr policy, status - 0x%x", |
717 | status); | 715 | status); |
718 | goto done; | 716 | goto done; |
@@ -721,7 +719,7 @@ u32 pmgr_policy_sw_setup(struct gk20a *g) | |||
721 | status = boardobjgrpconstruct_e32( | 719 | status = boardobjgrpconstruct_e32( |
722 | &g->pmgr_pmu.pmgr_policyobjs.pwr_policy_rels); | 720 | &g->pmgr_pmu.pmgr_policyobjs.pwr_policy_rels); |
723 | if (status) { | 721 | if (status) { |
724 | gk20a_err(dev_from_gk20a(g), | 722 | nvgpu_err(g, |
725 | "error creating boardobjgrp for pmgr policy rels, status - 0x%x", | 723 | "error creating boardobjgrp for pmgr policy rels, status - 0x%x", |
726 | status); | 724 | status); |
727 | goto done; | 725 | goto done; |
@@ -730,7 +728,7 @@ u32 pmgr_policy_sw_setup(struct gk20a *g) | |||
730 | status = boardobjgrpconstruct_e32( | 728 | status = boardobjgrpconstruct_e32( |
731 | &g->pmgr_pmu.pmgr_policyobjs.pwr_violations); | 729 | &g->pmgr_pmu.pmgr_policyobjs.pwr_violations); |
732 | if (status) { | 730 | if (status) { |
733 | gk20a_err(dev_from_gk20a(g), | 731 | nvgpu_err(g, |
734 | "error creating boardobjgrp for pmgr violations, status - 0x%x", | 732 | "error creating boardobjgrp for pmgr violations, status - 0x%x", |
735 | status); | 733 | status); |
736 | goto done; | 734 | goto done; |