79635402

Date: 2025-05-23 11:20:16
Score: 1
Natty:
Report link

I found the answer to the question:

static inline const char *pci_slot_name(const struct pci_slot *slot)

https://elixir.bootlin.com/linux/v6.12/source/include/linux/pci.h#L84

is the function that returns the physical slot number, same as lspci. It can be obtained from a struct pci_devpointer with:

const char *phys_slot_num=pci_slot_name(/*struct pci_dev*/ pdev->slot);
Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (0.5):
Posted by: Andrey Pro