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_dev.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_dev.c')
-rw-r--r-- | drivers/gpu/nvgpu/volt/volt_dev.c | 36 |
1 files changed, 16 insertions, 20 deletions
diff --git a/drivers/gpu/nvgpu/volt/volt_dev.c b/drivers/gpu/nvgpu/volt/volt_dev.c index 12bad36c..8e229f4c 100644 --- a/drivers/gpu/nvgpu/volt/volt_dev.c +++ b/drivers/gpu/nvgpu/volt/volt_dev.c | |||
@@ -174,7 +174,7 @@ struct voltage_device *volt_volt_device_construct(struct gk20a *g, | |||
174 | u32 status = construct_pwm_volt_device(g, &pboard_obj, | 174 | u32 status = construct_pwm_volt_device(g, &pboard_obj, |
175 | sizeof(struct voltage_device_pwm), pargs); | 175 | sizeof(struct voltage_device_pwm), pargs); |
176 | if (status) { | 176 | if (status) { |
177 | gk20a_err(dev_from_gk20a(g), | 177 | nvgpu_err(g, |
178 | " Could not allocate memory for VOLTAGE_DEVICE type (%x).", | 178 | " Could not allocate memory for VOLTAGE_DEVICE type (%x).", |
179 | BOARDOBJ_GET_TYPE(pargs)); | 179 | BOARDOBJ_GET_TYPE(pargs)); |
180 | pboard_obj = NULL; | 180 | pboard_obj = NULL; |
@@ -218,8 +218,7 @@ static u32 volt_get_voltage_device_table_1x_psv(struct gk20a *g, | |||
218 | 218 | ||
219 | if (ptmp_dev->super.operation_type == | 219 | if (ptmp_dev->super.operation_type == |
220 | CTRL_VOLT_DEVICE_OPERATION_TYPE_INVALID) { | 220 | CTRL_VOLT_DEVICE_OPERATION_TYPE_INVALID) { |
221 | gk20a_err(dev_from_gk20a(g), | 221 | nvgpu_err(g, " Invalid Voltage Device Operation Type."); |
222 | " Invalid Voltage Device Operation Type."); | ||
223 | 222 | ||
224 | status = -EINVAL; | 223 | status = -EINVAL; |
225 | goto done; | 224 | goto done; |
@@ -248,8 +247,7 @@ static u32 volt_get_voltage_device_table_1x_psv(struct gk20a *g, | |||
248 | volt_domain = volt_rail_vbios_volt_domain_convert_to_internal(g, | 247 | volt_domain = volt_rail_vbios_volt_domain_convert_to_internal(g, |
249 | (u8)p_bios_entry->volt_domain); | 248 | (u8)p_bios_entry->volt_domain); |
250 | if (volt_domain == CTRL_VOLT_DOMAIN_INVALID) { | 249 | if (volt_domain == CTRL_VOLT_DOMAIN_INVALID) { |
251 | gk20a_err(dev_from_gk20a(g), | 250 | nvgpu_err(g, "invalid voltage domain = %d", |
252 | "invalid voltage domain = %d", | ||
253 | (u8)p_bios_entry->volt_domain); | 251 | (u8)p_bios_entry->volt_domain); |
254 | status = -EINVAL; | 252 | status = -EINVAL; |
255 | goto done; | 253 | goto done; |
@@ -283,8 +281,7 @@ static u32 volt_get_voltage_device_table_1x_psv(struct gk20a *g, | |||
283 | 281 | ||
284 | pvolt_dev = volt_volt_device_construct(g, ptmp_dev); | 282 | pvolt_dev = volt_volt_device_construct(g, ptmp_dev); |
285 | if (pvolt_dev == NULL) { | 283 | if (pvolt_dev == NULL) { |
286 | gk20a_err(dev_from_gk20a(g), | 284 | nvgpu_err(g, " Failure to construct VOLTAGE_DEVICE object."); |
287 | " Failure to construct VOLTAGE_DEVICE object."); | ||
288 | 285 | ||
289 | status = -EINVAL; | 286 | status = -EINVAL; |
290 | goto done; | 287 | goto done; |
@@ -294,7 +291,7 @@ static u32 volt_get_voltage_device_table_1x_psv(struct gk20a *g, | |||
294 | &p_Volt_Device_Meta_Data->volt_devices.super, | 291 | &p_Volt_Device_Meta_Data->volt_devices.super, |
295 | (struct boardobj *)pvolt_dev, entry_Idx); | 292 | (struct boardobj *)pvolt_dev, entry_Idx); |
296 | if (status) { | 293 | if (status) { |
297 | gk20a_err(dev_from_gk20a(g), | 294 | nvgpu_err(g, |
298 | "could not add VOLTAGE_DEVICE for entry %d into boardobjgrp ", | 295 | "could not add VOLTAGE_DEVICE for entry %d into boardobjgrp ", |
299 | entry_Idx); | 296 | entry_Idx); |
300 | goto done; | 297 | goto done; |
@@ -320,7 +317,7 @@ static u32 volt_get_voltage_device_table_1x_psv(struct gk20a *g, | |||
320 | 317 | ||
321 | /* Check if there is room left in the voltage table. */ | 318 | /* Check if there is room left in the voltage table. */ |
322 | if (entry_cnt == VOLTAGE_TABLE_MAX_ENTRIES) { | 319 | if (entry_cnt == VOLTAGE_TABLE_MAX_ENTRIES) { |
323 | gk20a_err(dev_from_gk20a(g), "Voltage table is full"); | 320 | nvgpu_err(g, "Voltage table is full"); |
324 | status = -EINVAL; | 321 | status = -EINVAL; |
325 | goto done; | 322 | goto done; |
326 | } | 323 | } |
@@ -329,7 +326,7 @@ static u32 volt_get_voltage_device_table_1x_psv(struct gk20a *g, | |||
329 | volt_dev_construct_dev_entry_pwm(g, | 326 | volt_dev_construct_dev_entry_pwm(g, |
330 | voltage_uv, &pwm_entry); | 327 | voltage_uv, &pwm_entry); |
331 | if (pvolt_dev->pentry[entry_cnt] == NULL) { | 328 | if (pvolt_dev->pentry[entry_cnt] == NULL) { |
332 | gk20a_err(dev_from_gk20a(g), | 329 | nvgpu_err(g, |
333 | " Error creating voltage_device_pwm_entry!"); | 330 | " Error creating voltage_device_pwm_entry!"); |
334 | status = -EINVAL; | 331 | status = -EINVAL; |
335 | goto done; | 332 | goto done; |
@@ -463,7 +460,7 @@ u32 volt_device_state_init(struct gk20a *g, struct voltage_device *pvolt_dev) | |||
463 | rail_idx = volt_rail_volt_domain_convert_to_idx(g, | 460 | rail_idx = volt_rail_volt_domain_convert_to_idx(g, |
464 | pvolt_dev->volt_domain); | 461 | pvolt_dev->volt_domain); |
465 | if (rail_idx == CTRL_BOARDOBJ_IDX_INVALID) { | 462 | if (rail_idx == CTRL_BOARDOBJ_IDX_INVALID) { |
466 | gk20a_err(dev_from_gk20a(g), | 463 | nvgpu_err(g, |
467 | " could not convert voltage domain to rail index."); | 464 | " could not convert voltage domain to rail index."); |
468 | status = -EINVAL; | 465 | status = -EINVAL; |
469 | goto done; | 466 | goto done; |
@@ -471,7 +468,7 @@ u32 volt_device_state_init(struct gk20a *g, struct voltage_device *pvolt_dev) | |||
471 | 468 | ||
472 | pRail = VOLT_GET_VOLT_RAIL(&g->perf_pmu.volt, rail_idx); | 469 | pRail = VOLT_GET_VOLT_RAIL(&g->perf_pmu.volt, rail_idx); |
473 | if (pRail == NULL) { | 470 | if (pRail == NULL) { |
474 | gk20a_err(dev_from_gk20a(g), | 471 | nvgpu_err(g, |
475 | "could not obtain ptr to rail object from rail index"); | 472 | "could not obtain ptr to rail object from rail index"); |
476 | status = -EINVAL; | 473 | status = -EINVAL; |
477 | goto done; | 474 | goto done; |
@@ -480,7 +477,7 @@ u32 volt_device_state_init(struct gk20a *g, struct voltage_device *pvolt_dev) | |||
480 | status = volt_rail_volt_dev_register(g, pRail, | 477 | status = volt_rail_volt_dev_register(g, pRail, |
481 | BOARDOBJ_GET_IDX(pvolt_dev), pvolt_dev->operation_type); | 478 | BOARDOBJ_GET_IDX(pvolt_dev), pvolt_dev->operation_type); |
482 | if (status) { | 479 | if (status) { |
483 | gk20a_err(dev_from_gk20a(g), | 480 | nvgpu_err(g, |
484 | "Failed to register the device with rail obj"); | 481 | "Failed to register the device with rail obj"); |
485 | goto done; | 482 | goto done; |
486 | } | 483 | } |
@@ -488,8 +485,7 @@ u32 volt_device_state_init(struct gk20a *g, struct voltage_device *pvolt_dev) | |||
488 | 485 | ||
489 | done: | 486 | done: |
490 | if (status) | 487 | if (status) |
491 | gk20a_err(dev_from_gk20a(g), | 488 | nvgpu_err(g, "Error in building rail sw state device sw"); |
492 | "Error in building rail sw state device sw"); | ||
493 | 489 | ||
494 | return status; | 490 | return status; |
495 | } | 491 | } |
@@ -524,7 +520,7 @@ u32 volt_dev_sw_setup(struct gk20a *g) | |||
524 | status = boardobjgrpconstruct_e32(&g->perf_pmu.volt.volt_dev_metadata. | 520 | status = boardobjgrpconstruct_e32(&g->perf_pmu.volt.volt_dev_metadata. |
525 | volt_devices); | 521 | volt_devices); |
526 | if (status) { | 522 | if (status) { |
527 | gk20a_err(dev_from_gk20a(g), | 523 | nvgpu_err(g, |
528 | "error creating boardobjgrp for volt rail, status - 0x%x", | 524 | "error creating boardobjgrp for volt rail, status - 0x%x", |
529 | status); | 525 | status); |
530 | goto done; | 526 | goto done; |
@@ -547,7 +543,7 @@ u32 volt_dev_sw_setup(struct gk20a *g) | |||
547 | status = BOARDOBJGRP_PMU_CMD_GRP_SET_CONSTRUCT(g, pboardobjgrp, | 543 | status = BOARDOBJGRP_PMU_CMD_GRP_SET_CONSTRUCT(g, pboardobjgrp, |
548 | volt, VOLT, volt_device, VOLT_DEVICE); | 544 | volt, VOLT, volt_device, VOLT_DEVICE); |
549 | if (status) { | 545 | if (status) { |
550 | gk20a_err(dev_from_gk20a(g), | 546 | nvgpu_err(g, |
551 | "error constructing PMU_BOARDOBJ_CMD_GRP_SET interface - 0x%x", | 547 | "error constructing PMU_BOARDOBJ_CMD_GRP_SET interface - 0x%x", |
552 | status); | 548 | status); |
553 | goto done; | 549 | goto done; |
@@ -557,7 +553,7 @@ u32 volt_dev_sw_setup(struct gk20a *g) | |||
557 | &g->perf_pmu.volt.volt_dev_metadata.volt_devices.super, | 553 | &g->perf_pmu.volt.volt_dev_metadata.volt_devices.super, |
558 | volt, VOLT, volt_device, VOLT_DEVICE); | 554 | volt, VOLT, volt_device, VOLT_DEVICE); |
559 | if (status) { | 555 | if (status) { |
560 | gk20a_err(dev_from_gk20a(g), | 556 | nvgpu_err(g, |
561 | "error constructing PMU_BOARDOBJ_CMD_GRP_SET interface - 0x%x", | 557 | "error constructing PMU_BOARDOBJ_CMD_GRP_SET interface - 0x%x", |
562 | status); | 558 | status); |
563 | goto done; | 559 | goto done; |
@@ -569,9 +565,9 @@ u32 volt_dev_sw_setup(struct gk20a *g) | |||
569 | struct voltage_device *, pvolt_device, i) { | 565 | struct voltage_device *, pvolt_device, i) { |
570 | status = volt_device_state_init(g, pvolt_device); | 566 | status = volt_device_state_init(g, pvolt_device); |
571 | if (status) { | 567 | if (status) { |
572 | gk20a_err(dev_from_gk20a(g), | 568 | nvgpu_err(g, |
573 | "failure while executing devices's state init interface"); | 569 | "failure while executing devices's state init interface"); |
574 | gk20a_err(dev_from_gk20a(g), | 570 | nvgpu_err(g, |
575 | " railIdx = %d, status = 0x%x", i, status); | 571 | " railIdx = %d, status = 0x%x", i, status); |
576 | goto done; | 572 | goto done; |
577 | } | 573 | } |