__acpi_node_...ty_reference(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– __acpi_node_...ty_reference(9) πŸ’–

okay bestie, welcome to the Kernel API Manual β€” yes that's the manual name, we're being fancy today ✨ this one's a mouthful of a name (__acpi_node_...ty_reference(9), the truncated little icon that it is), so grab a strawberry drink πŸ“ and let's get into it.


🌸 NAME 🌸

__acpi_node_get_property_reference β€” literally returns a handle to the referenced object. that's the whole vibe. 🫢


✨ SYNOPSIS ✨

int __acpi_node_get_property_reference (const struct fwnode_handle
*fwnode , const char *propname , size_t index , size_t num_args , struct
fwnode_reference_args *args );

like, look at all those parameters. main character energy fr fr πŸ‘‘


πŸŽ€ ARGUMENTS πŸŽ€

  • fwnode β€” the firmware node we're pulling the property from, iykyk 🌈
  • propname β€” the name of the property. yes, this is the one we're hunting for πŸ’…
  • index β€” which reference in the lineup you want back. pick a number, any number πŸ¦‹
  • num_args β€” the max number of arguments allowed after each reference. cap it, periodt βœ‹
  • args β€” where the returned reference (plus any optional arguments) gets stored. it may be NULL, no pressure 😌

🧚 DESCRIPTION 🧚

so here's the tea β˜• β€” this function finds the property with that name, checks that it's a package containing at least one object reference, and if it is (slay), it stores the ACPI device object pointer to the target object in args->adev. 🎯 and if the reference comes with arguments? those get stashed in the args->args[] array. obsessed. πŸ’–

if there's more than one reference chillin' in the property value package, index is what picks which one you get back. lowkey the whole point of it. πŸ”₯

and here's the cute part β€” you can literally leave holes in the property value set, like this:

Package () { "cs-gpios", Package () { ^GPIO, 19, 0, 0, ^GPIO, 20, 0, 0, 0, ^GPIO, 21, 0, 0, } }

call this function with index 2 or index 3 and you get -ENOENT bestie 😭 it's not a bug, it's a gap. and if the property doesn't contain any more values, -ENOENT is returned too. the NULL entry must be a single integer and preferably contain the value 0. noted, no cap. πŸ“


⭐ RETURN ⭐

  • 0 on success πŸ₯³
  • a negative error code on failure πŸ’€

πŸ¦‹ SEE ALSO πŸ¦‹

kernel file ./drivers/acpi/property.c, plus the whole friend group:


ok real talk, that args parameter being allowed to be NULL is genuinely iconic β€” do with that what you will 🫢

and that's the page!! signed, sealed, delivered from ./drivers/acpi, dated October 2026, still rocking the __acpi_node_...ty_reference(9) title like the queen it is. mwah πŸ’‹πŸ’œ

πŸ“¦ where this page comes from