acpi_fetch_acpi_dev(9)
π acpi_fetch_acpi_dev
okay so first things first, this is a page from the Kernel API Manual (section 9, bestie, we're in kernel-internals territory π§) and it's all about one very specific little function. no cap, it's a short one, so let's get into it β¨
β¨ NAME β¨
acpi_fetch_acpi_dev β Retrieve ACPI device object π
like, it goes and gets the device object for you. that's the whole vibe check.
π¦ SYNOPSIS π¦
struct acpi_device * acpi_fetch_acpi_dev (acpi_handle handle );
so it hands you back a struct acpi_device * and it takes exactly one thing: an acpi_handle. iconic signature, no notes π
πΈ ARGUMENTS πΈ
handleβ the ACPI handle that's associated with the ACPI device object you're asking for π«Ά so like, this is your little claim ticket, and the function is the coat check.
π DESCRIPTION π
so here's what it does, and honestly it's giving "simple and reliable":
It returns a pointer to the ACPI device object associated with handle if present, or NULL otherwise. that's it. that's the function.
and like, the NULL case is not a bug, it's the function telling you "nope, nothing here bestie π" β so check your pointers before you dereference them, iykyk.
π₯ SEE ALSO π₯
if you're going down this rabbit hole (and honestly, respect), the kernel file to peek at is:
./drivers/acpi/scan.c
and here are all the sibling functions in the same neighborhood, fr fr β go read them, they're literally all here:
acpi_scan_drop_device(9)acpi_get_acpi_dev(9)acpi_dma_supported(9)acpi_get_dma_attr(9)acpi_dma_get_range(9)acpi_dma_configure_id(9)acpi_walk_dep_device_list(9)acpi_dev_clear_dependencies(9)acpi_dev_ready_for_enumeration(9)acpi_dev_get_next_consumer_dev(9)acpi_bus_scan(9)acpi_bus_trim(9)
tiny reminder:acpi_fetch_acpi_dev()gives you backNULLwhen there's no device for that handle β it does not invent one for you, so please don't treat it like it does π
anyway that's the whole page!! short, sweet, very main character energy for such a small function β
mwah π go fetch those device objects responsibly
β this little gem lives in ./drivers/acpi, and the page is dated October 2026, filed under acpi_fetch_acpi_dev(9) π take care bestie, ily, bye!! π
π¦ 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