acpi_dev_found(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ acpi_dev_found ✨

okay so bestie, welcome to the kernel API manual πŸ’… this one's a little cutie from the ACPI corner of the kernel, and honestly it's giving "is my device even here rn" energy. let's get into it 🫢


🌸 NAME 🌸

acpi_dev_found β€” bestie's whole job is detecting whether a given ACPI device is actually present in the namespace. that's it, that's the vibe check πŸ”βœ¨


πŸ¦‹ SYNOPSIS πŸ¦‹

bool acpi_dev_found (const char *hid );

πŸŽ€ ARGUMENTS πŸŽ€

  • hid β€” the Hardware ID of the device πŸ’– like, the lil name tag your device is wearing so we know which one we're looking for.

πŸ’œ DESCRIPTION πŸ’œ

so this function returns true if the device was present at the moment of invocation. at the moment, bestie β€” that's the key phrase πŸ‘€ note that if the device is pluggable, it may since have disappeared. so like, it could've dipped between you asking and you doing anything about it. tragic, but that's the deal 😭

🚨 for this function to actually work, acpi_bus_scan must have been executed β€” and that happens in the subsys_initcall subsection. so do not call it from a subsys_initcall or earlier (use acpi_get_devices instead, okay? πŸ’€). calling from module_init is totally fine, and that's synonymous with device_initcall ✨

so like, timing is everything here. call too early and it's not gonna slay, it's just gonna fail. respect the init order, periodt πŸ‘‘


🌈 SEE ALSO 🌈

kernel file ./drivers/acpi/utils.c, plus the whole friend group of related functions β€” go say hi πŸ’–:


and that's the whole page, bestie, no cap πŸŽ€ this lil icon lives in ./drivers/acpi and the docs are dated October 2026 β€” go forth and detect those devices, ily, bye πŸ’…βœ¨πŸ¦‹

πŸ“¦ where this page comes from