__thermal_zone_get_temp(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– __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 a struct 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 🌈

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