devm_therma...ice_register(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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 valid struct device pointer 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 a u32, it's a number, it goes in the cooling controller, periodt.
  • type β€” the thermal cooling device type. a const char *, so keep it cute and const.
  • devdata β€” device private data. your stuff, your business, hand it over as a void *. 🧚
  • ops β€” standard thermal cooling devices callbacks. the const 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 🌈

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