acpi_data_get_property(9)
π 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 notNULL. soNULLis 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 withnamehas 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 matchtype. 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:
acpi_dev_get_property(9)acpi_node_prop_get(9)acpi_data_get_property_array(9)__acpi_node_get_property_reference(9)acpi_node_prop_read(9)acpi_node_get_parent(9)acpi_graph_get_next_endpoint(9)acpi_graph_get_child_prop_value(9)acpi_graph_get_remote_endpoint(9)
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
- 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