devm_therma...ice_register(9)
π 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 validstruct devicepointer 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 π¦
- Kernel file
./drivers/thermal/thermal_fw.c thermal_fwnode_cooling_device_register(9)
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
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms