PCI: pciehp: Declare pciehp_unconfigure_device() void
authorLukas Wunner <lukas@wunner.de>
Thu, 19 Jul 2018 22:27:36 +0000 (17:27 -0500)
committerBjorn Helgaas <helgaas@kernel.org>
Mon, 23 Jul 2018 22:04:11 +0000 (17:04 -0500)
Since commit 0f4bd8014db5 ("PCI: hotplug: Drop checking of PCI_BRIDGE_
CONTROL in *_unconfigure_device()"), pciehp_unconfigure_device() can no
longer fail, so declare it and its sole caller remove_board() void, in
keeping with the usual kernel pattern that enablement can fail, but
disablement cannot.  No functional change intended.

Signed-off-by: Lukas Wunner <lukas@wunner.de>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Cc: Mika Westerberg <mika.westerberg@linux.intel.com>
drivers/pci/hotplug/pciehp.h
drivers/pci/hotplug/pciehp_ctrl.c
drivers/pci/hotplug/pciehp_pci.c

index fca87a1..acdeb08 100644 (file)
@@ -115,7 +115,7 @@ int pciehp_sysfs_enable_slot(struct slot *slot);
 int pciehp_sysfs_disable_slot(struct slot *slot);
 void pciehp_queue_interrupt_event(struct slot *slot, u32 event_type);
 int pciehp_configure_device(struct slot *p_slot);
-int pciehp_unconfigure_device(struct slot *p_slot);
+void pciehp_unconfigure_device(struct slot *p_slot);
 void pciehp_queue_pushbutton_work(struct work_struct *work);
 struct controller *pcie_init(struct pcie_device *dev);
 int pcie_init_notification(struct controller *ctrl);
index 4a4639b..76a9b8c 100644 (file)
@@ -119,14 +119,11 @@ err_exit:
  * remove_board - Turns off slot and LEDs
  * @p_slot: slot where board is being removed
  */
-static int remove_board(struct slot *p_slot)
+static void remove_board(struct slot *p_slot)
 {
-       int retval;
        struct controller *ctrl = p_slot->ctrl;
 
-       retval = pciehp_unconfigure_device(p_slot);
-       if (retval)
-               return retval;
+       pciehp_unconfigure_device(p_slot);
 
        if (POWER_CTRL(ctrl)) {
                pciehp_power_off_slot(p_slot);
@@ -141,7 +138,6 @@ static int remove_board(struct slot *p_slot)
 
        /* turn off Green LED */
        pciehp_green_led_off(p_slot);
-       return 0;
 }
 
 struct power_work_info {
@@ -421,7 +417,8 @@ int pciehp_disable_slot(struct slot *p_slot)
                }
        }
 
-       return remove_board(p_slot);
+       remove_board(p_slot);
+       return 0;
 }
 
 int pciehp_sysfs_enable_slot(struct slot *p_slot)
index 3f518de..5c58c22 100644 (file)
@@ -62,9 +62,8 @@ int pciehp_configure_device(struct slot *p_slot)
        return ret;
 }
 
-int pciehp_unconfigure_device(struct slot *p_slot)
+void pciehp_unconfigure_device(struct slot *p_slot)
 {
-       int rc = 0;
        u8 presence = 0;
        struct pci_dev *dev, *temp;
        struct pci_bus *parent = p_slot->ctrl->pcie->port->subordinate;
@@ -107,5 +106,4 @@ int pciehp_unconfigure_device(struct slot *p_slot)
        }
 
        pci_unlock_rescan_remove();
-       return rc;
 }