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

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
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1285,7 +1285,7 @@ static int smu10_read_sensor(struct pp_hwmgr *hwmgr, int idx,
		*size = 4;
		break;
	default:
		ret = -EINVAL;
		ret = -EOPNOTSUPP;
		break;
	}

+1 −1
Original line number Diff line number Diff line
@@ -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;
	}
}

+1 −1
Original line number Diff line number Diff line
@@ -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;
	}
}

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

+1 −1
Original line number Diff line number Diff line
@@ -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;
Loading