pci_get_slot(9)
πΈ NAME πΈ
Hii bestie! π You're looking at the pci_get_slot(9) page from the Kernel API Manual, and the whole vibe is: locate the PCI device for a given PCI slot. That's the mission, no cap. β¨
pci_get_slotβ locate PCI device for a given PCI slot π
π οΈ SYNOPSIS π οΈ
Okay so the signature is giving "kernel function, but make it official" π :
struct pci_dev * pci_get_slot (struct pci_bus *bus , unsigned int devfn
);
π ARGUMENTS π
busβ the PCI bus on which the desired PCI device resides. That's the hangout spot. π¦devfnβ encodes the number of the PCI slot in which the desired PCI device resides, plus the logical device number within that slot in case of multi-function devices. It's doing double duty, highkey iconic. π
π₯ DESCRIPTION π₯
Okay so here's the tea: given a PCI bus and slot/function number, the desired PCI device is located in the list of PCI devices. π΅οΈββοΈβ¨
If the device is found, its reference count is increased and this function returns a pointer to its data structure. Slay, but also responsibility. π
π¨ Real talk, bestie: the caller must decrement the reference count by calling pci_dev_put. Do not forget this part, fr fr. π
If no device is found, NULL is returned. That's the whole mood. π
π SEE ALSO π
- Kernel file
./drivers/pci/search.cπ pci_find_bus(9)pci_find_next_bus(9)pci_get_domain_bus_and_slot(9)pci_get_subsys(9)pci_get_device(9)pci_get_class(9)pci_get_base_class(9)pci_dev_present(9)
Mwah π cute little sign-off time: the source/version bit is ./drivers/pci, the date is October 2026, and the page is pci_get_slot(9). Bestie, you're so ready. π«Άπ
π¦ 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