]> Gentwo Git Trees - linux/.git/commit
PCI: Refactor extended capability search into PCI_FIND_NEXT_EXT_CAP()
authorHans Zhang <18255117159@163.com>
Wed, 13 Aug 2025 14:45:26 +0000 (22:45 +0800)
committerBjorn Helgaas <bhelgaas@google.com>
Thu, 14 Aug 2025 20:03:45 +0000 (15:03 -0500)
commit4d909bf1a53eb1e2e4d523a8d6f66532ac1bae0b
tree5148bab1eb28fabdf35a91420b5f2fe1993fcf8c
parent3c02084d8fa521192ea19722b1e5efae8096d939
PCI: Refactor extended capability search into PCI_FIND_NEXT_EXT_CAP()

Move the extended Capability search logic into a PCI_FIND_NEXT_EXT_CAP()
macro that accepts a config space accessor function as an argument. This
enables controller drivers to perform Capability discovery using their
early access mechanisms prior to full device initialization while sharing
the Capability search code.

Convert the existing PCI core extended Capability search implementation to
use PCI_FIND_NEXT_EXT_CAP().

Signed-off-by: Hans Zhang <18255117159@163.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Tested-by: Niklas Schnelle <schnelle@linux.ibm.com>
Link: https://patch.msgid.link/20250813144529.303548-4-18255117159@163.com
drivers/pci/pci.c
drivers/pci/pci.h