acpi_data_get_property(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… acpi_data_get_property(9) β€” Kernel API Manual

okay so bestie, welcome to the kernel API manual, specifically the page for acpi_data_get_property β€” this is the one you want when you need to grab an ACPI property by name. buckle up, it's short and sweet ✨


🌸 NAME 🌸

acpi_data_get_property β€” return an ACPI property with given name

like, that's literally the whole job. it gets you a property. by name. slay.


πŸ¦‹ SYNOPSIS πŸ¦‹

int acpi_data_get_property (const struct acpi_device_data *data , const
char *name , acpi_object_type type , const union acpi_object **obj );

that's the whole signature, copy it exactly if you're typing it out β€” no improvising, bestie, the compiler will absolutely clock you πŸ™ˆ


πŸŽ€ ARGUMENTS πŸŽ€

  • data β€” the ACPI device deta object you're pulling the property from. (yes, "deta". that's what the page says. i don't make the rules 😭 it's the device data object, you know what it means, moving on πŸ’…)
  • name β€” the name of the property. the literal string. the one you're looking for. icon behavior.
  • type β€” the expected property type. you're telling it what you expect, and it's gonna hold you to it (see RETURN, where mismatches get you an -EPROTO).
  • obj β€” the location where the property value gets stored, but only if it's not NULL. so NULL is allowed here, it just means nothing gets stored. no drama.

✨ DESCRIPTION ✨

so here's the vibe: it looks up a property with name, and if it finds it, it stores a pointer to the resulting ACPI object at the location that obj points to. that's it. that's the whole lookup-and-store situation, and honestly? obsessed. 🫢

⚠️ real talk, important caveat: callers must not attempt to free the returned objects. like, do NOT touch. hands off. the ACPI core frees these objects automatically during the removal of data. so if you go freeing them yourself you're gonna have a bad time, and not in a cute way πŸ’€

πŸ”₯ RETURN πŸ”₯

here's the scoreboard, and every single value matters so pay attention:

  • 0 β€” the property with name has been found. success! we ate. πŸ‘‘
  • -EINVAL β€” the arguments are invalid. so like, check your args first bestie.
  • -EINVAL β€” the property doesn't exist. yes, same error code as above, two different reasons, that's just how it is πŸ™ˆ
  • -EPROTO β€” the property value type doesn't match type. vibe check failed, the types didn't match, that's the whole thing.

🌈 SEE ALSO 🌈

the kernel file is ./drivers/acpi/property.c β€” that's where the magic lives, go read it if you're feeling brave 🧚

and the whole friend group of related calls:


and that's the page, bestie πŸ’– it lives in ./drivers/acpi and this particular version is dated October 2026 β€” so when you're citing it in your notes, that's the manual name and date to drop. now go get those properties. periodt. 🌟

πŸ“¦ where this page comes from