drm/amd/powerplay: refine phm_register_thermal_interrupt interface
authorRex Zhu <Rex.Zhu@amd.com>
Thu, 21 Sep 2017 02:34:48 +0000 (10:34 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 26 Sep 2017 19:14:19 +0000 (15:14 -0400)
currently, not all asics implement this callback function
so not return error to avoid powerplay initialize failed
in those asices

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/powerplay/hwmgr/hardwaremanager.c

index f31d2cf91f1aad6a1f1ebd06e664ba6a3eba6c87..623cff90233d450f60a7021b260edc7a7d63a911 100644 (file)
@@ -210,10 +210,10 @@ int phm_register_thermal_interrupt(struct pp_hwmgr *hwmgr, const void *info)
 {
        PHM_FUNC_CHECK(hwmgr);
 
-       if (hwmgr->hwmgr_func->register_internal_thermal_interrupt == NULL)
-               return -EINVAL;
+       if (hwmgr->hwmgr_func->register_internal_thermal_interrupt != NULL)
+               return hwmgr->hwmgr_func->register_internal_thermal_interrupt(hwmgr, info);
 
-       return hwmgr->hwmgr_func->register_internal_thermal_interrupt(hwmgr, info);
+       return 0;
 }
 
 /**