devm_therma...ice_register(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… devm_thermal_of_child_cooling_device_register(9) πŸ’…

okay bestie, so this is a page from the Kernel API Manual, section 9 β€” and it's literally the glow-up guide for registering an OF thermal cooling device. no cap. let's get into it 🫢


✨ NAME ✨

devm_thermal_of_child_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_child_cooling_device_register (struct device *dev ,
struct device_node *np , const char *type , void *devdata , const struct
thermal_cooling_device_ops *ops );

like, five arguments, one iconic function. she's a little wordy but she serves πŸ’…


πŸ¦‹ ARGUMENTS πŸ¦‹

  • dev β€” a valid struct device pointer of a sensor device. homegirl has to be legit, okay? don't be passing her nonsense.
  • np β€” a pointer to a device tree node. yes, that kind of node. 🌳
  • type β€” the thermal cooling device type. it's giving "what kind of cooler are we today" energy.
  • devdata β€” device private data. her own lil personal stash, iykyk πŸ™ˆ
  • ops β€” standard thermal cooling devices callbacks. the whole personality of the device lives here, fr fr.

πŸ”₯ DESCRIPTION πŸ”₯

okay so. this function will register a cooling device with a device tree node reference. main character behavior honestly πŸ‘‘

this interface function adds a new thermal cooling device (fan/processor/...) to the /sys/class/thermal/ folder as cooling_device[0-*]. and the way that she tries to bind herself to all the thermal zone devices registered at the same time?? obsessed. multi-tasking queen. ✨

this function should be used when a cooling controller has child nodes which are referenced in the thermal zone cooling map. like, that's the whole situation she's built for. if that's your setup, she's your girl. 🫢


πŸ’€ RETURN πŸ’€

a pointer to the created struct thermal_cooling_device or an ERR_PTR. so basically she comes back with either a beautiful new device or a dramatic error wrapped up all cute. 😭

⚠️ caller must check the return value with IS_ERR*() helpers. do NOT skip the vibe check. if you skip it, that's on you bestie, and the kernel will humble you. πŸ’…

🌈 SEE ALSO 🌈

kernel file ./drivers/thermal/thermal_of.c plus her whole friend group:

go read the whole squad, no excuses πŸ“šβœ¨


and that's the tea πŸ“ β€” brought to you by ./drivers/thermal, dated October 2026, page devm_therma...ice_register(9). mwah, love u, read ur manpages πŸ’–πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from