acpi_dev_get_next_match_dev(9)
π acpi_dev_get_next_match_dev(9) β like, the next ACPI device match, bestie
okay so this is a page from the Kernel API Manual (section 9, the kernel-api girlies) and the function we're obsessing over is acpi_dev_get_next_match_dev β¨ β aka "Return the next match of ACPI device." that's the whole NAME vibe, short and iconic.
β¨ SYNOPSIS β¨
struct acpi_device * acpi_dev_get_next_match_dev (struct acpi_device
*adev , const char *hid , const char *uid , s64 hrv );
like yes, that's the whole signature, four args, one struct acpi_device * coming back at you π«Ά
π ARGUMENTS π
adevβ Pointer to the previous ACPI device matching thishid,uidandhrv. it's literally "the one before," bestie, you gotta hand her the last match so she can find the next one π«hidβ Hardware ID of the device. no notes. π¦uidβ Unique ID of the device β passNULLto not check_UIDπ (opt out, queen)hrvβ Hardware Revision of the device β pass-1to not check_HRVπ (same energy, just don't check it)
πΈ DESCRIPTION πΈ
so here's the teaaaa: she returns the next match of an ACPI device if another matching device was present at the moment of invocation, or NULL otherwise. that's it, that's the function. no cap. β
now the part you actually need to remember, and I'm saying this with love π«Ά:
the caller is responsible for invokingacpi_dev_puton the returned device. meanwhile, the function itself invokesacpi_dev_puton the givenadev, assuming that its reference counter had been increased beforehand. π§
so like, refcount bookkeeping is your job, main character β she's just doing her part on adev and trusting you did yours π
and fr fr, go read acpi_dev_present for additional information as well β there's more lore there π
π₯ SEE ALSO π₯
Kernel file ./drivers/acpi/utils.c and, like, the whole friend group:
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_present(9)acpi_dev_get_first_match_dev(9)acpi_reduced_hardware(9)acpi_dev_is_video_device(9)acpi_match_platform_list(9)
ngl, if you made it this far you're lowkey a kernel dev now. slay. π
and that's a wrap, bestie π this one ships from ./drivers/acpi, dated October 2026, and the page answers to the name acpi_dev_get_next_match_dev(9) β k bye, mwah ππ
π¦ 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