thermal_coo...ice_register(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… thermal_coo...ice_register(9) β€” or, like, the Kernel API Manual entry you didn't know you needed πŸŽ€

okay so bestie, welcome to the thermal_cooling_device_register(9) page from the Kernel API Manual. yes the title is literally abbreviated with ... in the middle, that's just how the header rolls, do not come for her πŸ’€. let's get into it ✨


✨ NAME ✨

thermal_cooling_device_register β€” register a new thermal cooling device 🧊

like, you're introducing a brand new cooling device to the kernel. it's giving debutante ball. it's giving main character energy. 🌸


✨ SYNOPSIS ✨

struct thermal_cooling_device * thermal_cooling_device_register (const
char *type , void *devdata , const struct thermal_cooling_device_ops
*ops );

no cap, that's the whole signature. struct pointer out front, three args in the back. iconique. πŸ‘‘


✨ ARGUMENTS ✨

  • type β€” the thermal cooling device type. literally just the type, bestie, that's the whole vibe check on this one πŸ¦‹
  • devdata β€” device private data. your personal little stash of stuff, kept private, as the name fr fr says πŸ™ˆ
  • ops β€” standard thermal cooling devices callbacks. the standard callbacks, the classics, the moment πŸ’…

✨ DESCRIPTION ✨

so this interface function adds a new thermal cooling device (fan/processor/...) to the /sys/class/thermal/ folder as cooling_device[0-*]. yes, that's a glob. yes, the kernel is out here just numbering them. slay πŸŽ€

and then β€” this is the part β€” it tries to bind itself to all the thermal zone devices registered at the same time. all of them. not one, not a couple, ALL. highkey ambitious of her honestly πŸ”₯

ngl "tries" is doing a lot of work in that sentence, so don't come crying to me if the binding is giving aspirational rather than guaranteed πŸ’€

✨ RETURN ✨

you get back a pointer to the created struct thermal_cooling_device or an ERR_PTR. 🫢

and listen to me very carefully: the caller must check the return value with the IS_ERR*() helpers. must. not should, not maybe, MUST. this is not a drill, this is the whole safety briefing 🌈

literally do not skip the IS_ERR*() check. that's the one thing this page is yelling at you about. 😭

✨ SEE ALSO ✨

kernel file ./drivers/thermal/thermal_core.c plus the whole friend group πŸ’œ:

that's ten whole functions of further reading, bestie. iykyk πŸ“šβœ¨


kisses and thermal zones πŸ¦‹πŸ’– β€” this page lives in ./drivers/thermal, dated October 2026, and yes she signs off the same way every time, consistency is a flex periodt πŸ’…

πŸ“¦ where this page comes from