]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
PCI: Rename __pci_bus_reset() and __pci_slot_reset()
authorKeith Busch <kbusch@kernel.org>
Tue, 17 Feb 2026 16:08:34 +0000 (08:08 -0800)
committerBjorn Helgaas <bhelgaas@google.com>
Mon, 9 Mar 2026 20:27:45 +0000 (15:27 -0500)
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: Keith Busch <kbusch@kernel.org>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Dan Williams <dan.j.williams@intel.com>
Link: https://patch.msgid.link/20260217160836.2709885-2-kbusch@meta.com
drivers/pci/pci-sysfs.c
drivers/pci/pci.c
drivers/pci/pci.h

index 16eaaf749ba9705580ccc2c5ac7154336f821c9b..aaf92195da3218b538870dbc59df238e124252c5 100644 (file)
@@ -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;
index 8479c2e1f74f1044416281aba11bf071ea89488a..4fd61d6cacff920d53f5652c1cdfc06689e8bd51 100644 (file)
@@ -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);
 
index 13d998fbacce6698514d92500dfea03cc562cdc2..e319417da5caa6c1c8551fbeeca5505082d11ad9 100644 (file)
@@ -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;