aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci/hotplug/acpiphp_core.c
diff options
context:
space:
mode:
authorMika Westerberg <mika.westerberg@linux.intel.com>2013-07-13 17:27:26 -0400
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2013-07-22 22:00:25 -0400
commitad21d2d046a8a6bbf1b10c04770ec835a4e379e6 (patch)
tree79e2a6d6dfa85660cfd520e60c578859b3a1179d /drivers/pci/hotplug/acpiphp_core.c
parent07bb735378919e4b5863077f5c1b4037b6ca1a99 (diff)
ACPI / hotplug / PCI: Consolidate slot disabling and ejecting
Both acpiphp_disable_slot() and acpiphp_eject_slot() are always called together so instead of calling each separately we can consolidate them into one function acpiphp_disable_and_eject_slot() that does both (but it will return success on _EJ0 failures that were ignored in the majority of call sites anyway). [rjw: Rebased plus minor tweaks] Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/pci/hotplug/acpiphp_core.c')
-rw-r--r--drivers/pci/hotplug/acpiphp_core.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/drivers/pci/hotplug/acpiphp_core.c b/drivers/pci/hotplug/acpiphp_core.c
index 8f20e6021611..bf2203ef1308 100644
--- a/drivers/pci/hotplug/acpiphp_core.c
+++ b/drivers/pci/hotplug/acpiphp_core.c
@@ -155,15 +155,11 @@ static int enable_slot(struct hotplug_slot *hotplug_slot)
155static int disable_slot(struct hotplug_slot *hotplug_slot) 155static int disable_slot(struct hotplug_slot *hotplug_slot)
156{ 156{
157 struct slot *slot = hotplug_slot->private; 157 struct slot *slot = hotplug_slot->private;
158 int retval;
159 158
160 dbg("%s - physical_slot = %s\n", __func__, slot_name(slot)); 159 dbg("%s - physical_slot = %s\n", __func__, slot_name(slot));
161 160
162 /* disable the specified slot */ 161 /* disable the specified slot */
163 retval = acpiphp_disable_slot(slot->acpi_slot); 162 return acpiphp_disable_and_eject_slot(slot->acpi_slot);
164 if (!retval)
165 retval = acpiphp_eject_slot(slot->acpi_slot);
166 return retval;
167} 163}
168 164
169 165