Commit 84226677 authored by Keith Busch's avatar Keith Busch Committed by Bjorn Helgaas
Browse files

PCI: Rename __pci_bus_reset() and __pci_slot_reset()



Make the code a little easier to navigate with more descriptive function
names. The two renamed functions here "try" to do to a reset, so make that
clear in the name to distinguish them from other similarly named functions:

  __pci_reset_bus()    -> pci_try_reset_bus()
  __pci_reset_slot()   -> pci_try_reset_slot()

Signed-off-by: default avatarKeith Busch <kbusch@kernel.org>
Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
Reviewed-by: default avatarDan Williams <dan.j.williams@intel.com>
Link: https://patch.msgid.link/20260217160836.2709885-2-kbusch@meta.com
parent 6de23f81
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -563,7 +563,7 @@ static ssize_t reset_subordinate_store(struct device *dev,
		return -EINVAL;

	if (val) {
		int ret = __pci_reset_bus(bus);
		int ret = pci_try_reset_bus(bus);

		if (ret)
			return ret;
+5 −5
Original line number Diff line number Diff line
@@ -5541,7 +5541,7 @@ int pci_probe_reset_slot(struct pci_slot *slot)
EXPORT_SYMBOL_GPL(pci_probe_reset_slot);

/**
 * __pci_reset_slot - Try to reset a PCI slot
 * pci_try_reset_slot - Try to reset a PCI slot
 * @slot: PCI slot to reset
 *
 * A PCI bus may host multiple slots, each slot may support a reset mechanism
@@ -5555,7 +5555,7 @@ EXPORT_SYMBOL_GPL(pci_probe_reset_slot);
 *
 * Same as above except return -EAGAIN if the slot cannot be locked
 */
static int __pci_reset_slot(struct pci_slot *slot)
static int pci_try_reset_slot(struct pci_slot *slot)
{
	int rc;

@@ -5644,12 +5644,12 @@ int pci_probe_reset_bus(struct pci_bus *bus)
EXPORT_SYMBOL_GPL(pci_probe_reset_bus);

/**
 * __pci_reset_bus - Try to reset a PCI bus
 * pci_try_reset_bus - Try to reset a PCI bus
 * @bus: top level PCI bus to reset
 *
 * Same as above except return -EAGAIN if the bus cannot be locked
 */
int __pci_reset_bus(struct pci_bus *bus)
int pci_try_reset_bus(struct pci_bus *bus)
{
	int rc;

@@ -5678,7 +5678,7 @@ int __pci_reset_bus(struct pci_bus *bus)
int pci_reset_bus(struct pci_dev *pdev)
{
	return (!pci_probe_reset_slot(pdev->slot)) ?
	    __pci_reset_slot(pdev->slot) : __pci_reset_bus(pdev->bus);
	    pci_try_reset_slot(pdev->slot) : pci_try_reset_bus(pdev->bus);
}
EXPORT_SYMBOL_GPL(pci_reset_bus);

+1 −1
Original line number Diff line number Diff line
@@ -231,7 +231,7 @@ bool pci_reset_supported(struct pci_dev *dev);
void pci_init_reset_methods(struct pci_dev *dev);
int pci_bridge_secondary_bus_reset(struct pci_dev *dev);
int pci_bus_error_reset(struct pci_dev *dev);
int __pci_reset_bus(struct pci_bus *bus);
int pci_try_reset_bus(struct pci_bus *bus);

struct pci_cap_saved_data {
	u16		cap_nr;