power_supply...perty_direct(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– 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 about
  • val β€” 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 ⭐

  • 0 on 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 πŸ’œ:


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