pci_bus_match(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ pci_bus_match β€” the matchmaker of the PCI world πŸ’–

Okay bestie, so this one lives in the Kernel API Manual and it's literally the function that plays cupid between a PCI device and a driver's list of supported devices. Let's get into it πŸŽ€


🌸 SYNOPSIS 🌸

int pci_bus_match (struct device *dev , const struct device_driver *drv );

That's it, that's the whole vibe check ✨


🫢 ARGUMENTS 🫢

  • dev β€” the PCI device structure you're matching against, aka the main character we're trying to find a match for πŸ‘‘
  • drv β€” the device driver whose PCI device id structures we're gonna search through, like flipping through a driver's little black book πŸ’…

πŸ’œ DESCRIPTION πŸ’œ

So here's the tea: a driver uses this to check whether a PCI device that's actually present in the system shows up in its list of supported devices. That's it, that's the whole job β€” no cap 🧚

And what does it hand back? The matching pci_device_id structure, or NULL if there's no match. So if it returns NULL, it's giving "we're not compatible, it's not you it's me" energy πŸ’€

Like, think of it as the driver going "do I know you??" and the function going "yes bestie, here's the id struct" or "nope, never met them sorry" πŸ™ˆ

πŸ¦‹ SEE ALSO πŸ¦‹

Kernel file ./drivers/pci/pci-driver.c β€” the whole friend group lives here:


🌈 SIGN-OFF 🌈

This lil page is chillin' in ./drivers/pci and it's dated October 2026 β€” so yeah, future-iconic πŸ’« Obsessed, honestly. Go match some devices, bestie, you got this πŸ«ΆπŸ’–β­

πŸ“¦ where this page comes from