power_suppl...em_batteries(9)
πΈ power_suppl...em_batteries(9) πΈ
okay bestie so you're in the Kernel API Manual and the function we're talking about is literally power_supply_put_system_batteries β say it with me, it's a mouthful, i know π this is the cleanup half of the system-battery saga, the "ok we're done here, go home" twin π
β¨ NAME β¨
power_supply_put_system_batteries β the cleanup baddie that frees all the resources allocated by power_supply_get_system_batteries(). it's giving responsible queen energy π
you grabbed the references, now you put them back, periodt.
π¦ SYNOPSIS π¦
void power_supply_put_system_batteries (struct power_supply **psys , int count );
returning void β no cap, this one tells you nothing. it just does the thing and dips π
π ARGUMENTS π
psysβ array of power supply references to release and free. yes bestie, both π you hand it the array, it releases the refs and frees them. don't come back looking for them.countβ number of elements in the array. literally just how many things are inpsys, so it knows when to stop swiping π«Ά
π SEE ALSO π
- Kernel file:
./drivers/power/supply/power_supply_core.cβ the source, the origin story, the mothership π
and the whole friend group, fr fr:
power_supply_get_by_name(9)power_supply_get_system_batteries(9)power_supply_put(9)power_supply_get_by_reference(9)devm_power_supply_get_by_reference(9)power_supply_temp2resist_simple(9)power_supply_vbat2ri(9)power_supply_ocv2cap_simple(9)power_supply_get_property_direct(9)power_supply_set_property_direct(9)power_supply_register(9)devm_power_supply_register(9)power_supply_unregister(9)
lowkey the most important link in that chain is power_supply_get_system_batteries(9) β that's the one that made the mess this function cleans up. they're a package deal, iykyk π
and that's the whole page, bestie π no leaks, no dangling refs, we stan a clean teardown β
sign-off szn: this little gem lives over in ./drivers/power/supply and it's dated October 2026 β iconic, timeless, slay πβ¨
π¦ 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