pci_acpi_set..._lookup_hook(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… pci_acpi_set..._lookup_hook(9) β€” like, the kernel API manual bestie πŸ’–

okay so this is a page from the Kernel API Manual and the star of the show is literally pci_acpi_set..._lookup_hook(9). yes the title is abbreviated with dots, no we're not gonna fight about it, that's just how the man page header vibes ✨


🌸 NAME 🌸

pci_acpi_set_companion_lookup_hook β€” set that ACPI companion lookup callback, bestie πŸŽ€


✨ SYNOPSIS ✨

int pci_acpi_set_companion_lookup_hook (struct acpi_device
*(*func)(struct pci_dev *) );

like yes it's a function pointer returning a struct acpi_device * and taking a struct pci_dev *, and yes it returns an int. we love a signature that eats πŸ’…


πŸ¦‹ ARGUMENTS πŸ¦‹

  • func β€” your ACPI companion lookup callback pointer, or NULL if that's the mood 🫢 (NULL is allowed, no cap)

πŸ’– DESCRIPTION πŸ’–

okay so what this does is set a special ACPI companion lookup callback for PCI devices whose companion objects in the ACPI namespace have _ADR with non-standard bus-device-function encodings. like, the normal encoding wasn't serving, so this hook is the moment ✨ iykyk

it returns 0 on success or a negative error code on failure β€” and on failure, bestie, no changes are made. literally nothing happens. the vibe check failed, we move on 😭

also super important: the caller is responsible for the appropriate ordering of the invocations of this function with respect to the enumeration of the PCI devices needing the callback installed by it. like the ordering is not the function's problem, it's yours. main character responsibility energy πŸ‘‘

🌈 SEE ALSO 🌈

kernel file ./drivers/pci/pci-acpi.c β€” go read it, it's giving source code realness πŸ“

and the whole friend group:

look at that list. iconic. no notes πŸ’œ


aaaand that's the page, bestie πŸŽ€ it lives in ./drivers/pci, it's dated October 2026, and it answers to the name pci_acpi_set..._lookup_hook(9). slay, go forth and hook those lookups πŸ’…βœ¨

πŸ“¦ where this page comes from