drm/amdgpu/swsmu/vangogh: return error if fetching metrics fails

rather than just dropping the error.  Also fixes a set but not
used variable warning.

Reviewed-by: Evan Quan <evan.quan@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
Alex Deucher 2020-11-30 17:53:43 -05:00
parent 99698b51e5
commit b4339bb9a4
1 changed files with 2 additions and 0 deletions

View File

@ -410,6 +410,8 @@ static int vangogh_get_current_activity_percent(struct smu_context *smu,
ret = vangogh_get_smu_metrics_data(smu,
METRICS_AVERAGE_GFXACTIVITY,
value);
if (ret)
return ret;
break;
default:
dev_err(smu->adev->dev, "Invalid sensor for retrieving clock activity\n");