Skip to content

Commit 19fdb81

Browse files
committed
[Kernel][aarch64] Set mcelsius based on thermal_zone_get_temp()
1 parent 8db4dc4 commit 19fdb81

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

aarch64/corefreqk.c

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3999,12 +3999,21 @@ static void Core_Thermal_Temp(CORE_RO *Core)
39993999
{
40004000
#ifdef CONFIG_THERMAL
40014001
if (!IS_ERR(PRIVATE(OF(Core, AT(Core->Bind)))->ThermalZone)) {
4002-
int mcelsius;
4002+
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 3, 0)
4003+
unsigned int mcelsius;
40034004
if (thermal_zone_get_temp(PRIVATE(OF(Core, AT(Core->Bind)))->ThermalZone,
4004-
&mcelsius) == 0)
4005+
(int*) &mcelsius) == 0)
40054006
{
40064007
Core->PowerThermal.Sensor = mcelsius;
40074008
}
4009+
#else
4010+
unsigned long mcelsius;
4011+
if (thermal_zone_get_temp(PRIVATE(OF(Core, AT(Core->Bind)))->ThermalZone,
4012+
&mcelsius) == 0)
4013+
{
4014+
Core->PowerThermal.Sensor = (unsigned int) mcelsius;
4015+
}
4016+
#endif
40084017
}
40094018
#endif /* CONFIG_THERMAL */
40104019
}

0 commit comments

Comments
 (0)