]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
PCI: Consolidate pci_bus/slot_lock/unlock/trylock()
authorIlpo Järvinen <ilpo.jarvinen@linux.intel.com>
Wed, 4 Mar 2026 12:21:38 +0000 (14:21 +0200)
committerBjorn Helgaas <bhelgaas@google.com>
Mon, 9 Mar 2026 20:40:28 +0000 (15:40 -0500)
commit7b193af58b7f65715dc19e235e03e447a454b377
tree629c7c1d272bca1fead1a5932486edab1437faa2
parent8238cb69c01fe4dbb4e3be277fff3ed680ac0108
PCI: Consolidate pci_bus/slot_lock/unlock/trylock()

pci_bus/slot_lock/unlock/trylock() largely duplicate the bus iteration loop
with variation only due to slot filter handling. The only differences in
the loops is where the struct bus is found (directly in the argument vs in
slot->bus) and whether slot filter is applied. Those differences are simple
to handle using function parameters.

Consolidate the bus iteration loop to one place by creating
__pci_bus_{lock,unlock,trylock}() and call them from the non-underscore
locking functions.

Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Link: https://patch.msgid.link/20260304122139.1479-1-ilpo.jarvinen@linux.intel.com
drivers/pci/pci.c