summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/pstate
diff options
context:
space:
mode:
authorTerje Bergstrom <tbergstrom@nvidia.com>2017-04-06 15:30:48 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2017-04-10 15:24:16 -0400
commit94b62d68655f1ba45edf57df4a221f16c6562558 (patch)
treebb0fc9ca2df30bef2237a61f833e4a428e0bcc21 /drivers/gpu/nvgpu/pstate
parent4492737f3f4dcdabce3e11fb4eae00260dc4565a (diff)
gpu: nvgpu: pstate: 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: Ic3e6d7780ce62ccd87ff4759ac8ae6c3627199a0 Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com> Reviewed-on: http://git-master/r/1457349 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Alex Waterman <alexw@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/pstate')
-rw-r--r--drivers/gpu/nvgpu/pstate/pstate.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/drivers/gpu/nvgpu/pstate/pstate.c b/drivers/gpu/nvgpu/pstate/pstate.c
index 41c06a8a..3110239a 100644
--- a/drivers/gpu/nvgpu/pstate/pstate.c
+++ b/drivers/gpu/nvgpu/pstate/pstate.c
@@ -118,7 +118,7 @@ int gk20a_init_pstate_pmu_support(struct gk20a *g)
118 118
119 err = volt_pmu_send_load_cmd_to_pmu(g); 119 err = volt_pmu_send_load_cmd_to_pmu(g);
120 if (err) { 120 if (err) {
121 gk20a_err(dev_from_gk20a(g), 121 nvgpu_err(g,
122 "Failed to send VOLT LOAD CMD to PMU: status = 0x%08x.", 122 "Failed to send VOLT LOAD CMD to PMU: status = 0x%08x.",
123 err); 123 err);
124 return err; 124 return err;
@@ -209,7 +209,7 @@ struct pstate *pstate_construct(struct gk20a *g, void *args)
209 if ((tmp->super.type != CTRL_PERF_PSTATE_TYPE_3X) || 209 if ((tmp->super.type != CTRL_PERF_PSTATE_TYPE_3X) ||
210 (pstate_construct_3x(g, (struct boardobj **)&pstate, 210 (pstate_construct_3x(g, (struct boardobj **)&pstate,
211 sizeof(struct pstate), args))) 211 sizeof(struct pstate), args)))
212 gk20a_err(dev_from_gk20a(g), 212 nvgpu_err(g,
213 "error constructing pstate num=%u", tmp->num); 213 "error constructing pstate num=%u", tmp->num);
214 214
215 return pstate; 215 return pstate;
@@ -223,7 +223,7 @@ int pstate_insert(struct gk20a *g, struct pstate *pstate, int index)
223 err = boardobjgrp_objinsert(&pstates->super.super, 223 err = boardobjgrp_objinsert(&pstates->super.super,
224 (struct boardobj *)pstate, index); 224 (struct boardobj *)pstate, index);
225 if (err) { 225 if (err) {
226 gk20a_err(dev_from_gk20a(g), 226 nvgpu_err(g,
227 "error adding pstate boardobj %d", index); 227 "error adding pstate boardobj %d", index);
228 return err; 228 return err;
229 } 229 }
@@ -345,7 +345,7 @@ static int pstate_sw_setup(struct gk20a *g)
345 345
346 err = boardobjgrpconstruct_e32(&g->perf_pmu.pstatesobjs.super); 346 err = boardobjgrpconstruct_e32(&g->perf_pmu.pstatesobjs.super);
347 if (err) { 347 if (err) {
348 gk20a_err(dev_from_gk20a(g), 348 nvgpu_err(g,
349 "error creating boardobjgrp for pstates, err=%d", 349 "error creating boardobjgrp for pstates, err=%d",
350 err); 350 err);
351 goto done; 351 goto done;
@@ -356,15 +356,13 @@ static int pstate_sw_setup(struct gk20a *g)
356 g->bios.perf_token, PERFORMANCE_TABLE); 356 g->bios.perf_token, PERFORMANCE_TABLE);
357 357
358 if (!hdr) { 358 if (!hdr) {
359 gk20a_err(dev_from_gk20a(g), 359 nvgpu_err(g, "performance table not found");
360 "performance table not found");
361 err = -EINVAL; 360 err = -EINVAL;
362 goto done; 361 goto done;
363 } 362 }
364 363
365 if (hdr->version != VBIOS_PSTATE_TABLE_VERSION_5X) { 364 if (hdr->version != VBIOS_PSTATE_TABLE_VERSION_5X) {
366 gk20a_err(dev_from_gk20a(g), 365 nvgpu_err(g, "unknown/unsupported clocks table version=0x%02x",
367 "unknown/unsupported clocks table version=0x%02x",
368 hdr->version); 366 hdr->version);
369 err = -EINVAL; 367 err = -EINVAL;
370 goto done; 368 goto done;