aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu/cz_dpm.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/cz_dpm.c')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/cz_dpm.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/cz_dpm.c b/drivers/gpu/drm/amd/amdgpu/cz_dpm.c
index 9c2ab73a7ae3..e7ea28c0c5b8 100644
--- a/drivers/gpu/drm/amd/amdgpu/cz_dpm.c
+++ b/drivers/gpu/drm/amd/amdgpu/cz_dpm.c
@@ -44,6 +44,7 @@
44 44
45static void cz_dpm_powergate_uvd(struct amdgpu_device *adev, bool gate); 45static void cz_dpm_powergate_uvd(struct amdgpu_device *adev, bool gate);
46static void cz_dpm_powergate_vce(struct amdgpu_device *adev, bool gate); 46static void cz_dpm_powergate_vce(struct amdgpu_device *adev, bool gate);
47static void cz_dpm_fini(struct amdgpu_device *adev);
47 48
48static struct cz_ps *cz_get_ps(struct amdgpu_ps *rps) 49static struct cz_ps *cz_get_ps(struct amdgpu_ps *rps)
49{ 50{
@@ -411,11 +412,11 @@ static int cz_dpm_init(struct amdgpu_device *adev)
411 412
412 ret = amdgpu_get_platform_caps(adev); 413 ret = amdgpu_get_platform_caps(adev);
413 if (ret) 414 if (ret)
414 return ret; 415 goto err;
415 416
416 ret = amdgpu_parse_extended_power_table(adev); 417 ret = amdgpu_parse_extended_power_table(adev);
417 if (ret) 418 if (ret)
418 return ret; 419 goto err;
419 420
420 pi->sram_end = SMC_RAM_END; 421 pi->sram_end = SMC_RAM_END;
421 422
@@ -469,23 +470,26 @@ static int cz_dpm_init(struct amdgpu_device *adev)
469 470
470 ret = cz_parse_sys_info_table(adev); 471 ret = cz_parse_sys_info_table(adev);
471 if (ret) 472 if (ret)
472 return ret; 473 goto err;
473 474
474 cz_patch_voltage_values(adev); 475 cz_patch_voltage_values(adev);
475 cz_construct_boot_state(adev); 476 cz_construct_boot_state(adev);
476 477
477 ret = cz_parse_power_table(adev); 478 ret = cz_parse_power_table(adev);
478 if (ret) 479 if (ret)
479 return ret; 480 goto err;
480 481
481 ret = cz_process_firmware_header(adev); 482 ret = cz_process_firmware_header(adev);
482 if (ret) 483 if (ret)
483 return ret; 484 goto err;
484 485
485 pi->dpm_enabled = true; 486 pi->dpm_enabled = true;
486 pi->uvd_dynamic_pg = false; 487 pi->uvd_dynamic_pg = false;
487 488
488 return 0; 489 return 0;
490err:
491 cz_dpm_fini(adev);
492 return ret;
489} 493}
490 494
491static void cz_dpm_fini(struct amdgpu_device *adev) 495static void cz_dpm_fini(struct amdgpu_device *adev)