amdgpu/pm: read_sensor() report failure apporpriately

report -ENOTSUPP instead of -EINVAL, so that if userspace
fails to read sensor data can figure it out the failure correctly.

Signed-off-by: Shirish S <shirish.s@amd.com>
Reviewed-by: Evan Quan <evan.quan@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
Shirish S 2021-02-25 21:07:21 +05:30 committed by Alex Deucher
parent e9995d4a30
commit e0cd93b7e3
8 changed files with 8 additions and 8 deletions

View File

@ -1285,7 +1285,7 @@ static int smu10_read_sensor(struct pp_hwmgr *hwmgr, int idx,
*size = 4;
break;
default:
ret = -EINVAL;
ret = -EOPNOTSUPP;
break;
}

View File

@ -3945,7 +3945,7 @@ static int smu7_read_sensor(struct pp_hwmgr *hwmgr, int idx,
*((uint32_t *)value) = (uint32_t)convert_to_vddc(val_vid);
return 0;
default:
return -EINVAL;
return -EOPNOTSUPP;
}
}

View File

@ -1805,7 +1805,7 @@ static int smu8_read_sensor(struct pp_hwmgr *hwmgr, int idx,
*((uint32_t *)value) = smu8_thermal_get_temperature(hwmgr);
return 0;
default:
return -EINVAL;
return -EOPNOTSUPP;
}
}

View File

@ -3890,7 +3890,7 @@ static int vega10_read_sensor(struct pp_hwmgr *hwmgr, int idx,
*size = 8;
break;
default:
ret = -EINVAL;
ret = -EOPNOTSUPP;
break;
}

View File

@ -1429,7 +1429,7 @@ static int vega12_read_sensor(struct pp_hwmgr *hwmgr, int idx,
*size = 8;
break;
default:
ret = -EINVAL;
ret = -EOPNOTSUPP;
break;
}
return ret;

View File

@ -2240,7 +2240,7 @@ static int vega20_read_sensor(struct pp_hwmgr *hwmgr, int idx,
*size = 8;
break;
default:
ret = -EINVAL;
ret = -EOPNOTSUPP;
break;
}
return ret;

View File

@ -3305,7 +3305,7 @@ static int kv_dpm_read_sensor(void *handle, int idx,
*size = 4;
return 0;
default:
return -EINVAL;
return -EOPNOTSUPP;
}
}

View File

@ -8014,7 +8014,7 @@ static int si_dpm_read_sensor(void *handle, int idx,
*size = 4;
return 0;
default:
return -EINVAL;
return -EOPNOTSUPP;
}
}