devm_therma...ice_register(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… devm_therma...ice_register(9) β€” Kernel API Manual, but make it make sense πŸ’…

okay bestie, so we're in the kernel API manual today (yes, that one), and the star of the show is devm_thermal_fwnode_cooling_device_register ✨ she's got a long name, she's got main character energy, and she's literally here to register a thermal cooling device. no cap.


✨ NAME ✨

devm_thermal_fwnode_cooling_device_register β€” register a thermal cooling device 🧊πŸ”₯


πŸŽ€ SYNOPSIS πŸŽ€

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

like, five arguments. she's high maintenance but she's worth it 🫢


πŸ’– ARGUMENTS πŸ’–

  • dev β€” a valid struct device pointer of a sensor device. valid, babes. valid. don't be out here passing garbage πŸ™ˆ
  • fwn_index β€” literally marked -- undescribed -- in the docs πŸ’€ so yeah, that's all we know. iconic of her honestly.
  • type β€” the thermal cooling device type.
  • devdata β€” device private data. your stuff. your vibe. πŸŽ€
  • ops β€” standard thermal cooling devices callbacks.

🌸 DESCRIPTION 🌸

so what does she actually do? this function will register a cooling device with a firmware node reference ✨ periodt.

this interface function adds a new thermal cooling device (fan/processor/...) to the /sys/class/thermal/ folder as cooling_device[0-*] 🌈 and then β€” the way that she does the absolute most β€” it tries to bind itself to all the thermal zone devices registered at the same time. multitasking queen πŸ‘‘ lowkey obsessed.


⭐ RETURN ⭐

she returns a pointer to the created struct thermal_cooling_device, or an ERR_PTR 😭

bestie listen to me: caller must check the return value with the IS_ERR*() helpers. this is not optional, this is not a drill, this is the whole vibe check πŸ’€

πŸ¦‹ SEE ALSO πŸ¦‹


and that's the page, bestie!! πŸ“ dropped from ./drivers/thermal, dated October 2026, headed to you straight from the devm_therma...ice_register(9) era πŸ’œ go forth and check your IS_ERR*() helpers, iykyk 🧚✨

πŸ“¦ where this page comes from