]> git.karo-electronics.de Git - linux-beck.git/commitdiff
PCI: pciehp: Leave power indicator on when enabling already-enabled slot
authorAshok Raj <ashok.raj@intel.com>
Sat, 19 Nov 2016 08:32:46 +0000 (00:32 -0800)
committerBjorn Helgaas <bhelgaas@google.com>
Thu, 8 Dec 2016 18:02:25 +0000 (12:02 -0600)
If an error occurs when enabling a slot, pciehp_power_thread() turns off
the power indicator.  But if the only error is that the slot was already
enabled, we should leave the power indicator on.

Return success if called to enable an already-enabled slot.
This is in the same spirit of the special handling for EEXISTS when
pciehp_configure_device() determines the slot devices already exist.

Signed-off-by: Ashok Raj <ashok.raj@intel.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Keith Busch <keith.busch@intel.com>
drivers/pci/hotplug/pciehp_ctrl.c

index efe69e879455cbd19ac4733d863d81d6666c3a7b..ec0b4c11ccd9dc95cdb738d03ae292744e34127e 100644 (file)
@@ -410,7 +410,7 @@ int pciehp_enable_slot(struct slot *p_slot)
                if (getstatus) {
                        ctrl_info(ctrl, "Slot(%s): Already enabled\n",
                                  slot_name(p_slot));
-                       return -EINVAL;
+                       return 0;
                }
        }