devm_thermal...ice_register(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… devm_thermal_cooling_device_register(9) β€” like, the whole lore

okay bestie, so this page lives in the Kernel API Manual, and it's literally all about devm_thermal_cooling_device_register β€” yes that's a mouthful, we're gonna get through it together 🫢


✨ NAME ✨

devm_thermal_cooling_device_register β€” register a thermal cooling device. that's it, that's the vibe check πŸ’–


🌸 SYNOPSIS 🌸

struct thermal_cooling_device * devm_thermal_cooling_device_register
(struct device *dev , const char *type , void *devdata , const struct
thermal_cooling_device_ops *ops );

no cap, that's the whole signature. four arguments, zero drama (okay maybe a lil drama, keep reading) πŸ¦‹


πŸŽ€ ARGUMENTS πŸŽ€

  • dev β€” a valid struct device pointer of a sensor device. like, it has to be valid fr fr, don't be out here passing garbage πŸ™ˆ
  • type β€” the thermal cooling device type. this is the label bestie πŸ’…
  • devdata β€” device private data. your personal little stash 🌸
  • ops β€” standard thermal cooling devices callbacks. the actual behavior lives here ⭐

πŸ”₯ DESCRIPTION πŸ”₯

so this function will register a cooling device. iconic behavior honestly πŸ‘‘

this interface function adds a new thermal cooling device (fan/processor/...) to /sys/class/thermal/ folder as cooling_device[0-*]. yes, with a bracket-star and everything, it's giving index energy 😭

and then β€” the main character move β€” it tries to bind itself to all the thermal zone devices registered at the same time. not one, not two, all of them. periodt πŸ’€


πŸ’œ RETURN πŸ’œ

it returns a pointer to the created struct thermal_cooling_device, or an ERR_PTR.

⚠️ bestie listen to me: caller must check return value with IS_ERR*() helpers. do not skip this. this is the one rule πŸ™

🌈 SEE ALSO 🌈


and that's the page, bestie πŸ§šπŸ’– quick sign-off so you have the receipts: this one's sourced from ./drivers/thermal, dated October 2026, and it's filed under devm_thermal...ice_register(9) β€” the truncated name is literally how it ships, don't @ me 😭✨

slay, go register some cooling devices responsibly πŸ“πŸ‘‘

πŸ“¦ where this page comes from