thermal_of_zone_register(9)
π thermal_of_zone_register β Kernel API Manual, bestie edition π
okay so picture this: it's giving kernel API manual, it's page thermal_of_zone_register(9), and it's literally about registering a thermal zone with a device node sensor. yes bestie, we're doing device tree stuff today and you're gonna slay it β¨
β¨ NAME β¨
thermal_of_zone_register β register a thermal zone with a device node sensor π‘οΈπ
π¦ SYNOPSIS π¦
struct thermal_zone_device * thermal_of_zone_register (struct
device_node *sensor , int id , void *data , const struct
thermal_zone_device_ops *ops );
like, that's the whole call, no cap. four args, one pointer back, periodt π
πΈ ARGUMENTS πΈ
sensorβ adevice_nodepointer that corresponds to the sensor in the device tree. this is your main character pointer fr π³idβ an integer that acts as the sensor identifier. yes it's just an int, and yes it matters π«dataβ private data that gets stored in the thermal zone's dedicated private area. your lil stash of vibes πopsβ a set of thermal sensor ops. theconst struct thermal_zone_device_ops *of it all, iykyk π«Ά
π DESCRIPTION π
so what does thermal_of_zone_register actually do? it parses a device tree given a device node sensor and an id. it goes looking for the thermal zone associated to the couple sensor/id, then retrieves all the thermal zone properties, and registers a new thermal zone with those properties. that's it, that's the whole glow-up β¨π₯
lowkey iconic behavior honestly β parse, retrieve, register, done π
π RETURN π
on success you get a valid thermal zone structure pointer. slay. π
but bestie, sometimes it does not slay, and here's the receipts:
EINVALβ if the device tree thermal description is malformed π (the DT said what it said and what it said was wrong)ENOMEMβ if one structure can not be allocated π memory said no- Other negative errors are returned by the underlying called functions β so like, not this function's fault, it's handing you the error from somewhere deeper down the stack π
π₯ SEE ALSO π₯
kernel file ./drivers/thermal/thermal_of.c is the home base, and then the whole friend group:
thermal_of_get_trip_type(9)thermal_of_zone_unregister(9)devm_thermal_of_zone_register(9)devm_thermal_of_zone_unregister(9)thermal_of_cooling_device_register(9)devm_thermal_of_cooling_device_register(9)devm_thermal_of_child_cooling_device_register(9)
ngl that's a whole group chat right there π«Άπ
π‘ friendly reminder from your local unix girlie: these are pointers and ids, not vibes β don't manifest a malformed device tree and then act surprised when you get EINVAL π
alright bestie, that's the page!! source/version vibes live at ./drivers/thermal, dated October 2026, and the whole thing answers to the name thermal_of_zone_register(9). go register something iconic π
βπ
π¦ 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