gpu: nvgpu: therm: 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: I50bab058076c6896acfc6fa82f78f52a949dd3cf
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: http://git-master/r/1457354
Reviewed-by: Alex Waterman <alexw@nvidia.com>
This commit is contained in:
Terje Bergstrom
2017-04-06 13:02:43 -07:00
committed by mobile promotions
parent 54eb745393
commit 3a1104c369
7 changed files with 41 additions and 50 deletions

View File

@@ -30,8 +30,7 @@ static void perfrpc_pmucmdhandler(struct gk20a *g, struct pmu_msg *msg,
gk20a_dbg_info("");
if (msg->msg.perf.msg_type != NV_PMU_PERF_MSG_ID_RPC) {
gk20a_err(dev_from_gk20a(g),
"unsupported msg for VFE LOAD RPC %x",
nvgpu_err(g, "unsupported msg for VFE LOAD RPC %x",
msg->msg.perf.msg_type);
return;
}
@@ -97,8 +96,7 @@ u32 perf_pmu_vfe_load(struct gk20a *g)
&seqdesc, ~0);
if (status) {
gk20a_err(dev_from_gk20a(g),
"unable to post perf RPC cmd %x",
nvgpu_err(g, "unable to post perf RPC cmd %x",
cmd.cmd.perf.cmd_type);
goto done;
}
@@ -109,7 +107,7 @@ u32 perf_pmu_vfe_load(struct gk20a *g)
if (handler.success == 0) {
status = -EINVAL;
gk20a_err(dev_from_gk20a(g), "rpc call to load VFE failed");
nvgpu_err(g, "rpc call to load VFE failed");
}
done:
return status;

View File

@@ -34,8 +34,7 @@ static u32 _vfe_equs_pmudatainit(struct gk20a *g,
status = boardobjgrp_pmudatainit_e255(g, pboardobjgrp, pboardobjgrppmu);
if (status) {
gk20a_err(dev_from_gk20a(g),
"error updating pmu boardobjgrp for vfe equ 0x%x",
nvgpu_err(g, "error updating pmu boardobjgrp for vfe equ 0x%x",
status);
goto done;
}
@@ -74,7 +73,7 @@ u32 vfe_equ_sw_setup(struct gk20a *g)
status = boardobjgrpconstruct_e255(&g->perf_pmu.vfe_equobjs.super);
if (status) {
gk20a_err(dev_from_gk20a(g),
nvgpu_err(g,
"error creating boardobjgrp for clk domain, status - 0x%x",
status);
goto done;
@@ -88,7 +87,7 @@ u32 vfe_equ_sw_setup(struct gk20a *g)
status = BOARDOBJGRP_PMU_CMD_GRP_SET_CONSTRUCT(g, pboardobjgrp,
perf, PERF, vfe_equ, VFE_EQU);
if (status) {
gk20a_err(dev_from_gk20a(g),
nvgpu_err(g,
"error constructing PMU_BOARDOBJ_CMD_GRP_SET interface - 0x%x",
status);
goto done;
@@ -223,8 +222,7 @@ static u32 devinit_get_vfe_equ_table(struct gk20a *g,
break;
default:
gk20a_err(dev_from_gk20a(g),
"unrecognized output id @vfeequ index %d",
nvgpu_err(g, "unrecognized output id @vfeequ index %d",
index);
goto done;
}
@@ -278,7 +276,7 @@ static u32 devinit_get_vfe_equ_table(struct gk20a *g,
CTRL_PERF_VFE_EQU_COMPARE_FUNCTION_GREATER;
break;
default:
gk20a_err(dev_from_gk20a(g),
nvgpu_err(g,
"invalid vfe compare index %x type %x ",
index, cmp_func);
status = -EINVAL;
@@ -295,8 +293,7 @@ static u32 devinit_get_vfe_equ_table(struct gk20a *g,
}
default:
status = -EINVAL;
gk20a_err(dev_from_gk20a(g),
"Invalid equ[%d].type = 0x%x.",
nvgpu_err(g, "Invalid equ[%d].type = 0x%x.",
index, (u8)equ.type);
goto done;
}
@@ -305,7 +302,7 @@ static u32 devinit_get_vfe_equ_table(struct gk20a *g,
pequ = construct_vfe_equ(g, (void *)&equ_data);
if (pequ == NULL) {
gk20a_err(dev_from_gk20a(g),
nvgpu_err(g,
"error constructing vfe_equ boardobj %d", index);
status = -EINVAL;
goto done;
@@ -314,8 +311,7 @@ static u32 devinit_get_vfe_equ_table(struct gk20a *g,
status = boardobjgrp_objinsert(&pvfeequobjs->super.super,
(struct boardobj *)pequ, index);
if (status) {
gk20a_err(dev_from_gk20a(g),
"error adding vfe_equ boardobj %d", index);
nvgpu_err(g, "error adding vfe_equ boardobj %d", index);
status = -EINVAL;
goto done;
}

View File

@@ -40,7 +40,7 @@ static u32 _vfe_vars_pmudatainit(struct gk20a *g,
status = boardobjgrp_pmudatainit_e32(g, pboardobjgrp, pboardobjgrppmu);
if (status) {
gk20a_err(dev_from_gk20a(g),
nvgpu_err(g,
"error updating pmu boardobjgrp for vfe var 0x%x",
status);
goto done;
@@ -100,7 +100,7 @@ u32 vfe_var_sw_setup(struct gk20a *g)
status = boardobjgrpconstruct_e32(&g->perf_pmu.vfe_varobjs.super);
if (status) {
gk20a_err(dev_from_gk20a(g),
nvgpu_err(g,
"error creating boardobjgrp for clk domain, status - 0x%x",
status);
goto done;
@@ -114,7 +114,7 @@ u32 vfe_var_sw_setup(struct gk20a *g)
status = BOARDOBJGRP_PMU_CMD_GRP_SET_CONSTRUCT(g, pboardobjgrp,
perf, PERF, vfe_var, VFE_VAR);
if (status) {
gk20a_err(dev_from_gk20a(g),
nvgpu_err(g,
"error constructing PMU_BOARDOBJ_CMD_GRP_SET interface - 0x%x",
status);
goto done;
@@ -132,7 +132,7 @@ u32 vfe_var_sw_setup(struct gk20a *g)
&g->perf_pmu.vfe_varobjs.super.super,
perf, PERF, vfe_var, VFE_VAR);
if (status) {
gk20a_err(dev_from_gk20a(g),
nvgpu_err(g,
"error constructing PMU_BOARDOBJ_CMD_GRP_GET_STATUS interface - 0x%x",
status);
goto done;
@@ -196,14 +196,14 @@ u32 dev_init_get_vfield_info(struct gk20a *g,
memcpy(&vregheader, vfieldregtableptr, VFIELD_REG_HEADER_SIZE);
if (vregheader.version != VBIOS_VFIELD_REG_TABLE_VERSION_1_0) {
gk20a_err(dev_from_gk20a(g), "invalid vreg header version");
nvgpu_err(g, "invalid vreg header version");
goto done;
}
memcpy(&vheader, vfieldtableptr, VFIELD_HEADER_SIZE);
if (vregheader.version != VBIOS_VFIELD_TABLE_VERSION_1_0) {
gk20a_err(dev_from_gk20a(g), "invalid vfield header version");
nvgpu_err(g, "invalid vfield header version");
goto done;
}
@@ -660,13 +660,13 @@ static u32 vfe_var_construct_single_sensed_fuse(struct gk20a *g,
dev_init_get_vfield_info(g, pvfevar);
/*check whether fuse segment got initialized*/
if (pvfevar->vfield_info.fuse.segment_count == 0) {
gk20a_err(dev_from_gk20a(g), "unable to get fuse reg info %x",
nvgpu_err(g, "unable to get fuse reg info %x",
pvfevar->vfield_info.v_field_id);
status = -EINVAL;
goto exit;
}
if (pvfevar->vfield_ver_info.fuse.segment_count == 0) {
gk20a_err(dev_from_gk20a(g), "unable to get fuse reg info %x",
nvgpu_err(g, "unable to get fuse reg info %x",
pvfevar->vfield_ver_info.v_field_id_ver);
status = -EINVAL;
goto exit;
@@ -997,7 +997,7 @@ static u32 devinit_get_vfe_var_table(struct gk20a *g,
pvar = construct_vfe_var(g, &var_data);
if (pvar == NULL) {
gk20a_err(dev_from_gk20a(g),
nvgpu_err(g,
"error constructing vfe_var boardobj %d",
index);
status = -EINVAL;
@@ -1007,8 +1007,7 @@ static u32 devinit_get_vfe_var_table(struct gk20a *g,
status = boardobjgrp_objinsert(&pvfevarobjs->super.super,
(struct boardobj *)pvar, index);
if (status) {
gk20a_err(dev_from_gk20a(g),
"error adding vfe_var boardobj %d", index);
nvgpu_err(g, "error adding vfe_var boardobj %d", index);
status = -EINVAL;
goto done;
}