devm_therma...ice_register(9)
π devm_thermal_of_cooling_device_register(9) β like, the whole glow-up
okay so this page lives in the Kernel API Manual (yes bestie, the big one), and the header is being a little dramatic and truncating itself as devm_therma...ice_register(9) β the full name is devm_thermal_of_cooling_device_register, iykyk. π
β¨ NAME β¨
devm_thermal_of_cooling_device_register β register an OF thermal cooling device. that's it, that's the whole vibe. π
πΈ SYNOPSIS πΈ
struct thermal_cooling_device * devm_thermal_of_cooling_device_register
(struct device *dev , u32 cdev_id , const char *type , void *devdata ,
const struct thermal_cooling_device_ops *ops );
literally just call it with those five things and she's off. π¦
π«Ά ARGUMENTS π«Ά
devβ a validstruct devicepointer of a sensor device. like, actually valid, don't be out here passing vibes-only pointers, she will notice. πcdev_idβ a cooling device index in the cooling controller. it's au32, it's a number, it goes in the cooling controller, periodt.typeβ the thermal cooling device type. aconst char *, so keep it cute and const.devdataβ device private data. your stuff, your business, hand it over as avoid *. π§opsβ standard thermal cooling devices callbacks. theconst struct thermal_cooling_device_ops *kind. this is where the main character energy actually lives. π
π₯ DESCRIPTION π₯
so the way that this function works is: it registers a cooling device with a device tree node reference. not me being obsessed with the phrasing, but that's exactly what it does β it's the devm-flavored, device-tree-node-reference-taking registration girlie. β¨
this interface function adds a new thermal cooling device (fan/processor/...) to the /sys/class/thermal/ folder as cooling_device[0-*]. yes bestie, the [0-*] is doing a lot of work there, but it's the original, we stan. it genuinely tries to bind itself to all the thermal zone devices registered at the same time β like it's walking into the group chat and adding itself to every conversation. π
β RETURN β
it returns a pointer to the created struct thermal_cooling_device β¦ or an ERR_PTR. π
β οΈ caller must check the return value with the IS_ERR*() helpers. no cap. if you skip the check, that's on you, not on her. π
π SEE ALSO π
- Kernel file
./drivers/thermal/thermal_of.c thermal_of_get_trip_type(9)thermal_of_zone_unregister(9)thermal_of_zone_register(9)devm_thermal_of_zone_register(9)devm_thermal_of_zone_unregister(9)thermal_of_cooling_device_register(9)devm_thermal_of_child_cooling_device_register(9)
like a whole friend group honestly. go read all of them, they're iconic. π
and that's the page!! sourced straight from ./drivers/thermal, dated October 2026 β so she's from the future, obvs, and the header says devm_therma...ice_register(9) one more time on the way out because she loves a dramatic exit. slay, bye, see you at the thermal zone ππ¦πΈ
π¦ 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