diff options
author | Terje Bergstrom <tbergstrom@nvidia.com> | 2017-04-06 15:47:54 -0400 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2017-04-10 22:04:20 -0400 |
commit | a9c4c5d88db75d5ba2327fe16d3be1654518ccaf (patch) | |
tree | 33deafe68e266e23559103146c755f11469c0f5b /drivers/gpu/nvgpu/volt/volt_pmu.c | |
parent | 57d624f900896a257e2e918e93e99a14f734aea5 (diff) |
gpu: nvgpu: volt: 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: Iea4a2f81d3aa2ff409fbb4bf9db441401f3a41e5
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: http://git-master/r/1457352
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Alex Waterman <alexw@nvidia.com>
Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com>
GVS: Gerrit_Virtual_Submit
Diffstat (limited to 'drivers/gpu/nvgpu/volt/volt_pmu.c')
-rw-r--r-- | drivers/gpu/nvgpu/volt/volt_pmu.c | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/drivers/gpu/nvgpu/volt/volt_pmu.c b/drivers/gpu/nvgpu/volt/volt_pmu.c index f8167000..dd2a0a63 100644 --- a/drivers/gpu/nvgpu/volt/volt_pmu.c +++ b/drivers/gpu/nvgpu/volt/volt_pmu.c | |||
@@ -38,7 +38,7 @@ static void volt_rpc_pmucmdhandler(struct gk20a *g, struct pmu_msg *msg, | |||
38 | gk20a_dbg_info(""); | 38 | gk20a_dbg_info(""); |
39 | 39 | ||
40 | if (msg->msg.volt.msg_type != NV_PMU_VOLT_MSG_ID_RPC) { | 40 | if (msg->msg.volt.msg_type != NV_PMU_VOLT_MSG_ID_RPC) { |
41 | gk20a_err(dev_from_gk20a(g), "unsupported msg for VOLT RPC %x", | 41 | nvgpu_err(g, "unsupported msg for VOLT RPC %x", |
42 | msg->msg.volt.msg_type); | 42 | msg->msg.volt.msg_type); |
43 | return; | 43 | return; |
44 | } | 44 | } |
@@ -82,7 +82,7 @@ static u32 volt_pmu_rpc_execute(struct gk20a *g, | |||
82 | volt_rpc_pmucmdhandler, (void *)&handler, | 82 | volt_rpc_pmucmdhandler, (void *)&handler, |
83 | &seqdesc, ~0); | 83 | &seqdesc, ~0); |
84 | if (status) { | 84 | if (status) { |
85 | gk20a_err(dev_from_gk20a(g), "unable to post volt RPC cmd %x", | 85 | nvgpu_err(g, "unable to post volt RPC cmd %x", |
86 | cmd.cmd.volt.cmd_type); | 86 | cmd.cmd.volt.cmd_type); |
87 | goto volt_pmu_rpc_execute; | 87 | goto volt_pmu_rpc_execute; |
88 | } | 88 | } |
@@ -93,7 +93,7 @@ static u32 volt_pmu_rpc_execute(struct gk20a *g, | |||
93 | 93 | ||
94 | if (handler.success == 0) { | 94 | if (handler.success == 0) { |
95 | status = -EINVAL; | 95 | status = -EINVAL; |
96 | gk20a_err(dev_from_gk20a(g), "rpc call to volt failed"); | 96 | nvgpu_err(g, "rpc call to volt failed"); |
97 | } | 97 | } |
98 | 98 | ||
99 | volt_pmu_rpc_execute: | 99 | volt_pmu_rpc_execute: |
@@ -109,7 +109,7 @@ u32 volt_pmu_send_load_cmd_to_pmu(struct gk20a *g) | |||
109 | 109 | ||
110 | status = volt_pmu_rpc_execute(g, &rpc_call); | 110 | status = volt_pmu_rpc_execute(g, &rpc_call); |
111 | if (status) | 111 | if (status) |
112 | gk20a_err(dev_from_gk20a(g), | 112 | nvgpu_err(g, |
113 | "Error while executing LOAD RPC: status = 0x%08x.", | 113 | "Error while executing LOAD RPC: status = 0x%08x.", |
114 | status); | 114 | status); |
115 | 115 | ||
@@ -126,7 +126,7 @@ static u32 volt_rail_get_voltage(struct gk20a *g, | |||
126 | rail_idx = volt_rail_volt_domain_convert_to_idx(g, volt_domain); | 126 | rail_idx = volt_rail_volt_domain_convert_to_idx(g, volt_domain); |
127 | if ((rail_idx == CTRL_VOLT_RAIL_INDEX_INVALID) || | 127 | if ((rail_idx == CTRL_VOLT_RAIL_INDEX_INVALID) || |
128 | (!VOLT_RAIL_INDEX_IS_VALID(&g->perf_pmu.volt, rail_idx))) { | 128 | (!VOLT_RAIL_INDEX_IS_VALID(&g->perf_pmu.volt, rail_idx))) { |
129 | gk20a_err(dev_from_gk20a(g), | 129 | nvgpu_err(g, |
130 | "failed: volt_domain = %d, voltage rail table = %d.", | 130 | "failed: volt_domain = %d, voltage rail table = %d.", |
131 | volt_domain, rail_idx); | 131 | volt_domain, rail_idx); |
132 | return -EINVAL; | 132 | return -EINVAL; |
@@ -139,7 +139,7 @@ static u32 volt_rail_get_voltage(struct gk20a *g, | |||
139 | /* Execute the voltage get request via PMU RPC. */ | 139 | /* Execute the voltage get request via PMU RPC. */ |
140 | status = volt_pmu_rpc_execute(g, &rpc_call); | 140 | status = volt_pmu_rpc_execute(g, &rpc_call); |
141 | if (status) { | 141 | if (status) { |
142 | gk20a_err(dev_from_gk20a(g), | 142 | nvgpu_err(g, |
143 | "Error while executing volt_rail_get_voltage rpc"); | 143 | "Error while executing volt_rail_get_voltage rpc"); |
144 | return status; | 144 | return status; |
145 | } | 145 | } |
@@ -166,11 +166,10 @@ static u32 volt_policy_set_voltage(struct gk20a *g, u8 client_id, | |||
166 | CTRL_VOLT_DOMAIN_INVALID) || | 166 | CTRL_VOLT_DOMAIN_INVALID) || |
167 | (prail_list->rails[i].voltage_uv == | 167 | (prail_list->rails[i].voltage_uv == |
168 | NV_PMU_VOLT_VALUE_0V_IN_UV)) { | 168 | NV_PMU_VOLT_VALUE_0V_IN_UV)) { |
169 | gk20a_err(dev_from_gk20a(g), "Invalid voltage domain or target "); | 169 | nvgpu_err(g, "Invalid voltage domain or target"); |
170 | gk20a_err(dev_from_gk20a(g), " client_id = %d, listEntry = %d ", | 170 | nvgpu_err(g, " client_id = %d, listEntry = %d", |
171 | client_id, i); | 171 | client_id, i); |
172 | gk20a_err(dev_from_gk20a(g), | 172 | nvgpu_err(g, " volt_domain = %d, voltage_uv = %d uV.", |
173 | "volt_domain = %d, voltage_uv = %d uV.", | ||
174 | prail_list->rails[i].volt_domain, | 173 | prail_list->rails[i].volt_domain, |
175 | prail_list->rails[i].voltage_uv); | 174 | prail_list->rails[i].voltage_uv); |
176 | status = -EINVAL; | 175 | status = -EINVAL; |
@@ -196,7 +195,7 @@ static u32 volt_policy_set_voltage(struct gk20a *g, u8 client_id, | |||
196 | /* Execute the voltage change request via PMU RPC. */ | 195 | /* Execute the voltage change request via PMU RPC. */ |
197 | status = volt_pmu_rpc_execute(g, &rpc_call); | 196 | status = volt_pmu_rpc_execute(g, &rpc_call); |
198 | if (status) | 197 | if (status) |
199 | gk20a_err(dev_from_gk20a(g), | 198 | nvgpu_err(g, |
200 | "Error while executing VOLT_POLICY_SET_VOLTAGE RPC"); | 199 | "Error while executing VOLT_POLICY_SET_VOLTAGE RPC"); |
201 | 200 | ||
202 | exit: | 201 | exit: |
@@ -244,7 +243,7 @@ static int volt_policy_set_noiseaware_vmin(struct gk20a *g, | |||
244 | /* Execute the voltage change request via PMU RPC. */ | 243 | /* Execute the voltage change request via PMU RPC. */ |
245 | status = volt_pmu_rpc_execute(g, &rpc_call); | 244 | status = volt_pmu_rpc_execute(g, &rpc_call); |
246 | if (status) { | 245 | if (status) { |
247 | gk20a_err(dev_from_gk20a(g), | 246 | nvgpu_err(g, |
248 | "Error while executing VOLT_POLICY_SET_VOLTAGE RPC"); | 247 | "Error while executing VOLT_POLICY_SET_VOLTAGE RPC"); |
249 | return -EINVAL; | 248 | return -EINVAL; |
250 | } | 249 | } |