acpi_dev_present(9)
π acpi_dev_present(9) β bestie's guide to the Kernel API Manual β¨
okay so real talk, this is a page from the Kernel API Manual and it's about acpi_dev_present(9), which lowkey does exactly what it says on the tin π«Ά
β¨ NAME β¨
acpi_dev_present β detect that a given ACPI device is present πβ¨
πΈ SYNOPSIS πΈ
bool acpi_dev_present (const char *hid , const char *uid , s64 hrv );
like, that's the whole vibe. three args, one bool, no drama π
π ARGUMENTS π
hidβ the Hardware ID of the device. the main character identifier fr π₯uidβ the Unique ID of the device. if you don't wanna check_UID, just passNULLand keep it moving πhrvβ the Hardware Revision of the device. don't care about_HRV? pass-1and slay π
π¦ DESCRIPTION π¦
so here's the tea: it returns true if a matching device was present at the moment of invocation. at the moment. like right then. β°
β οΈ heads up bestie: if the device is pluggable, it may have disappeared since then. it's giving "you blinked and it was gone" π do NOT treat that true as a forever-promise.
also, this is not the same as acpi_dev_found β this one actually checks the status of the device. so for devices that are present in the DSDT but are disabled (their _STA callback returns 0), this function will return false. no cap, that's a whole different vibe check π
for this function to work, acpi_bus_scan must have been executed, which happens in the subsys_initcall subsection. so:
- π« do not call from a
subsys_initcallor earlier (useacpi_get_devicesinstead, king behavior π) - β
calling from
module_initis totally fine β it's synonymous withdevice_initcall, iykyk
π SEE ALSO π
the kernel file ./drivers/acpi/utils.c and honestly a whole friend group of functions:
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_found(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 crumbs left, every single reference accounted for, periodt π
sign-off time π this one lives in ./drivers/acpi, dated October 2026 β go check the device, have fun, don't call it too early, ily πβ¨
π¦ 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