__thermal_zone_get_temp(9)
π __thermal_zone_get_temp(9) π
okay so bestie, welcome to the Kernel API Manual β this is the page about the lil internal helper that goes and grabs a thermal zone's temperature for you. it's lowkey iconic, no cap.
β¨ NAME β¨
__thermal_zone_get_temp β returns the temperature of a thermal zone π‘οΈ
πΈ SYNOPSIS πΈ
int __thermal_zone_get_temp (struct thermal_zone_device *tz , int *temp );
π ARGUMENTS π
tzβ a valid pointer to astruct thermal_zone_device. like, valid valid. we'll get to that.tempβ a valid pointer to where to store the resulting temperature. this is where the answer goes, bestie. give it somewhere to live.
π¦ DESCRIPTION π¦
so when you pass in a valid thermal zone reference, this function will fetch its temperature and fill temp for you. that's the whole vibe. it reads the temp, it writes it to your pointer. slay. π
but here's the part where you gotta pay attention, fr fr:
both tz and tz->ops must be valid pointers when calling this function, and the tz->ops.get_temp callback must be provided. no callback, no temp. that's the rule.
and the big one: the function must be called under tz->lock. like, you have to be holding that lock. this is not a suggestion, this is not optional, do not pass go. π
β RETURN β
on success it returns 0 π β an error code otherwise π
π SEE ALSO π
- Kernel file
./drivers/thermal/thermal_helpers.cπ thermal_zone_get_temp(9)thermal_cdev_update(9)thermal_cdev_update_nocheck(9)thermal_zone_get_slope(9)thermal_zone_get_offset(9)
go read those next, iykyk π«Ά
mwah π this page lives in ./drivers/thermal, dated October 2026 β that's the source and the version, bestie, and that's the whole manpage. you ate that. πβ¨
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms