power_supply...perty_direct(9)
π power_supply_get_property_direct β a.k.a. the NAME section, bestie π
okay so this is a page from the Kernel API Manual and it's about one very specific little function: power_supply_get_property_direct. It reads a power supply property without checking for extensions, and honestly? iconic behavior. Let's get into it π«Ά
β¨ SYNOPSIS β¨
int power_supply_get_property_direct (struct power_supply *psy , enum
power_supply_property psp , union power_supply_propval *val );
that's the whole vibe right there β three args, one int coming back at you π
πΈ ARGUMENTS πΈ
psyβ the power supply itself, the main character of this whole story πpspβ the power supply property you wanna read, like which specific lil fact you're asking aboutvalβ where the resulting value of the power supply property lands once it's read π
π¦ DESCRIPTION π¦
so here's the tea: this reads a power supply property without taking into account any power supply extensions registered on the given power supply. like, it just goes straight to the source and ignores the extensions entirely. no cap.
and the way this is mostly useful is for power supply extensions that want to access their own power supply β because if you used power_supply_get_property directly instead, you'd run into a potential deadlock ππ
β οΈ fr fr bestie: that deadlock is the whole reason this direct version exists. extensions touching their own power supply need this one, not the regular one. noted and memorized π
β RETURN β
0on success π- a negative error code on failure π
that's it, that's the whole return situation. slay.
π§ SEE ALSO π§
kernel file ./drivers/power/supply/power_supply_core.c
and the whole friend group π:
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_set_property_direct(9)power_supply_register(9)devm_power_supply_register(9)power_supply_unregister(9)
and that's the page!! π brought to you from ./drivers/power/supply, dated October 2026 β go off, kernel docs, periodt πβ¨
π¦ 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