acpi_dev_found(9)
β¨ 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_scanmust have been executed β and that happens in thesubsys_initcallsubsection. so do not call it from asubsys_initcallor earlier (useacpi_get_devicesinstead, okay? π). calling frommodule_initis totally fine, and that's synonymous withdevice_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 π:
acpi_handle_list_equal(9)acpi_handle_list_replace(9)acpi_handle_list_free(9)acpi_device_dep(9)acpi_evaluate_ost(9)acpi_handle_path(9)acpi_handle_printk(9)__acpi_handle_debug(9)acpi_evaluation_failure_warn(9)acpi_has_method(9)acpi_evaluate_ej0(9)acpi_evaluate_lck(9)acpi_evaluate_reg(9)acpi_evaluate_dsm(9)acpi_check_dsm(9)acpi_dev_uid_to_integer(9)acpi_dev_present(9)acpi_dev_get_next_match_dev(9)acpi_dev_get_first_match_dev(9)acpi_reduced_hardware(9)acpi_dev_is_video_device(9)acpi_match_platform_list(9)
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
- 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