]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
drm/amdgpu/powerplay: return success if set_mp1_state is not set
authorAlex Deucher <alexander.deucher@amd.com>
Wed, 31 Jul 2019 02:27:03 +0000 (21:27 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 31 Jul 2019 04:24:25 +0000 (23:24 -0500)
Some asics (APUs) don't have this callback so we want to return
success.  Avoids spurious error messages on APUs.

Reviewed-by: Evan Quan <evan.quan@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/powerplay/amd_powerplay.c

index 88a2ef75b7e1208866546852901b2a9affa4ea01..2e3d9ef625bf9cbcb9933ef83dc028ebfa9e3049 100644 (file)
@@ -931,12 +931,10 @@ static int pp_dpm_set_mp1_state(void *handle, enum pp_mp1_state mp1_state)
        if (!hwmgr || !hwmgr->pm_en)
                return -EINVAL;
 
-       if (hwmgr->hwmgr_func->set_mp1_state == NULL) {
-               pr_info_ratelimited("%s was not implemented.\n", __func__);
-               return -EINVAL;
-       }
+       if (hwmgr->hwmgr_func->set_mp1_state)
+               return hwmgr->hwmgr_func->set_mp1_state(hwmgr, mp1_state);
 
-       return hwmgr->hwmgr_func->set_mp1_state(hwmgr, mp1_state);
+       return 0;
 }
 
 static int pp_dpm_switch_power_profile(void *handle,