Fix crash when disabling dpm.
v2: agd5f: fix coding style, cleanup commit message
Signed-off-by: Sonny Jiang <sonny.jiang@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
static int cz_dpm_hw_init(struct amdgpu_device *adev)
{
- int ret;
-
- if (!amdgpu_dpm)
- return 0;
+ int ret = 0;
mutex_lock(&adev->pm.mutex);
return ret;
}
+ if (!amdgpu_dpm) {
+ adev->pm.dpm_enabled = false;
+ mutex_unlock(&adev->pm.mutex);
+ return ret;
+ }
+
/* cz dpm setup asic */
cz_dpm_setup_asic(adev);
return ret;
}
+ if (!amdgpu_dpm) {
+ adev->pm.dpm_enabled = false;
+ mutex_unlock(&adev->pm.mutex);
+ return ret;
+ }
+
/* cz dpm setup asic */
cz_dpm_setup_asic(adev);