power_supply_unregister(9)
β¨ power_supply_unregister(9) β¨
okay so bestie, welcome to the Kernel API Manual</> π this one is a kernel function, and it's honestly so straightforward, like the cleanup era of your power supply's life π
πΈ NAME πΈ
power_supply_unregister β Remove this power supply from system π«Ά like, bye babe, you're out of the system now β¨
β SYNOPSIS β
void power_supply_unregister (struct power_supply *psy );
that's it, that's the whole vibe check π
π¦ ARGUMENTS π¦
psyβ Pointer to power supply to unregister π literally just a pointer to the power supply you're kicking out of the system, no cap
π DESCRIPTION π
So the tea π: this function removes this power supply from the system. That's the whole main character moment β¨
And about the memory situation β the resources of the power supply get freed either here or on the last power_supply_put call. so it's giving "cleanup happens now, or whenever the last put happens" π no leak drama, it's handled, iykyk π§
lowkey important detail bestie: it's not always freed right here β sometimes it waits for that last power_supply_put call. don't forget that part!! π
π₯ SEE ALSO π₯
- Kernel file:
./drivers/power/supply/power_supply_core.c power_supply_get_by_name(9)power_supply_get_system_batteries(9)power_supply_put_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)
like, the whole friend group honestly π go read them all, they ate π₯
and that's the page!! πβ¨ this was pulled from the ./drivers/power/supply</> section of the Kernel API Manual, dated October 2026, and yeah β it's literally titled power_supply_unregister(9) π bye bestie, go unregister responsibly π«Άπ
π¦ 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