pci_get_device(9)
π pci_get_device(9)
okay so this is a page from the Kernel API Manual β it's pci_get_device(9), and bestie, it's literally the glow-up your PCI device hunt needed β¨
πΈ NAME
pci_get_device β begin or continue searching for a PCI device by vendor/device id π
π SYNOPSIS
struct pci_dev * pci_get_device (unsigned int vendor , unsigned int
device , struct pci_dev *from );
β¨ ARGUMENTS
vendorβ the PCI vendor id you're matching on π·οΈ β¦ orPCI_ANY_IDif you're in your "I'll take anyone" era and wanna match all vendor ids.deviceβ the PCI device id to match, orPCI_ANY_IDto match all device ids π«Άfromβ the previous PCI device found in the search, orNULLfor a brand new search. main character energy either way π
π¦ DESCRIPTION
So it iterates through the list of known PCI devices. Iconic. π
If a PCI device is found with a matching vendor and device, the reference count to the device is incremented and a pointer to its device structure is returned β¨ Otherwise? NULL is returned. That's it. No crumbs. π
A new search is initiated by passing NULL as the from argument π± Otherwise, if from is not NULL, the search continues from the next device on the global list π
Also lowkey important: the reference count forfromis always decremented if it is notNULL. not me reminding you twice, it's giving "this will bite you" π
π SEE ALSO
- Kernel file
./drivers/pci/search.c pci_find_bus(9)pci_find_next_bus(9)pci_get_slot(9)pci_get_domain_bus_and_slot(9)pci_get_subsys(9)pci_get_class(9)pci_get_base_class(9)pci_dev_present(9)
all of these are fr fr your besties, go read them too π«Άπ
mwah π that's the whole page! it lives in ./drivers/pci, dated October 2026, and it's filed under pci_get_device(9) in the Kernel API Manual β periodt. ππΈ
π¦ 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