From: Ashok Raj Date: Sat, 19 Nov 2016 08:32:46 +0000 (-0800) Subject: PCI: pciehp: Leave power indicator on when enabling already-enabled slot X-Git-Tag: v4.1.12-92~24^2~14 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=5604ba1205200813cd3f717d578199363eca1f68;p=users%2Fjedix%2Flinux-maple.git PCI: pciehp: Leave power indicator on when enabling already-enabled slot 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. Orabug: 25312751 Signed-off-by: Ashok Raj Signed-off-by: Bjorn Helgaas Reviewed-by: Keith Busch (cherry picked from commit c4ae2adedb38240be5a1a16588406980b948a3e7) Signed-off-by: Jack Vogel Signed-off-by: Dhaval Giani --- diff --git a/drivers/pci/hotplug/pciehp_ctrl.c b/drivers/pci/hotplug/pciehp_ctrl.c index f052e951b23e8..8edcf86c3c3be 100644 --- a/drivers/pci/hotplug/pciehp_ctrl.c +++ b/drivers/pci/hotplug/pciehp_ctrl.c @@ -583,7 +583,7 @@ int pciehp_enable_slot(struct slot *p_slot) if (getstatus) { ctrl_info(ctrl, "Already enabled on slot(%s)\n", slot_name(p_slot)); - return -EINVAL; + return 0; } }