Commit e0cd93b7 authored by Shirish S's avatar Shirish S Committed by Alex Deucher

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: default avatarShirish S <shirish.s@amd.com>
Reviewed-by: default avatarEvan Quan <evan.quan@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent e9995d4a
......@@ -1285,7 +1285,7 @@ static int smu10_read_sensor(struct pp_hwmgr *hwmgr, int idx,
*size = 4;
break;
default:
ret = -EINVAL;
ret = -EOPNOTSUPP;
break;
}
......
......@@ -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;
}
}
......
......@@ -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;
}
}
......
......@@ -3890,7 +3890,7 @@ static int vega10_read_sensor(struct pp_hwmgr *hwmgr, int idx,
*size = 8;
break;
default:
ret = -EINVAL;
ret = -EOPNOTSUPP;
break;
}
......
......@@ -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;
......
......@@ -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;
......
......@@ -3305,7 +3305,7 @@ static int kv_dpm_read_sensor(void *handle, int idx,
*size = 4;
return 0;
default:
return -EINVAL;
return -EOPNOTSUPP;
}
}
......
......@@ -8014,7 +8014,7 @@ static int si_dpm_read_sensor(void *handle, int idx,
*size = 4;
return 0;
default:
return -EINVAL;
return -EOPNOTSUPP;
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment