In case CONFIG_DRM_AMD_POWERPLAY is defined and amdgpu.powerplay=0.
some functions in powrplay can also be called by DAL. and the input parameter is *adev.
if just check point not NULL was not enough and will lead to NULL point error.
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
struct amd_pp_simple_clock_info simple_clocks;
struct pp_clock_info hw_clocks;
- if (handle == NULL || clocks == NULL)
+ PP_CHECK((struct pp_instance *)handle);
+
+ if (clocks == NULL)
return -EINVAL;
hwmgr = ((struct pp_instance *)handle)->hwmgr;
struct pp_hwmgr *hwmgr;
- if (handle == NULL || clocks == NULL)
+ PP_CHECK((struct pp_instance *)handle);
+
+ if (clocks == NULL)
return -EINVAL;
hwmgr = ((struct pp_instance *)handle)->hwmgr;
int result = -1;
struct pp_hwmgr *hwmgr;
- if (handle == NULL || clocks == NULL)
+ PP_CHECK((struct pp_instance *)handle);
+
+ if (clocks == NULL)
return -EINVAL;
hwmgr = ((struct pp_instance *)handle)->hwmgr;