pci_get_device(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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 🏷️ … or PCI_ANY_ID if you're in your "I'll take anyone" era and wanna match all vendor ids.
  • device β€” the PCI device id to match, or PCI_ANY_ID to match all device ids 🫢
  • from β€” the previous PCI device found in the search, or NULL for 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 for from is always decremented if it is not NULL. not me reminding you twice, it's giving "this will bite you" 😭

πŸ‘‘ SEE ALSO

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