aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci/hotplug/pciehp_core.c
diff options
context:
space:
mode:
authorKenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>2006-12-21 20:01:09 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2007-02-07 18:50:05 -0500
commit44ef4cefb0168740184ee3d7d18254339741e9d5 (patch)
tree9ae7d2d94c6bec9fe1b6c0a9ddf7e78994ea4dc9 /drivers/pci/hotplug/pciehp_core.c
parent75e13178af33e20b5802885f637af2a82c64ac2c (diff)
pciehp: cleanup wait command completion
This patch cleans up the code to wait for command completion. Signed-off-by: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com> Signed-off-by: Kristen Carlson Accardi <kristen.c.accardi@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/pci/hotplug/pciehp_core.c')
-rw-r--r--drivers/pci/hotplug/pciehp_core.c14
1 files changed, 1 insertions, 13 deletions
diff --git a/drivers/pci/hotplug/pciehp_core.c b/drivers/pci/hotplug/pciehp_core.c
index e2d45662bdbf..f7b8e0504fec 100644
--- a/drivers/pci/hotplug/pciehp_core.c
+++ b/drivers/pci/hotplug/pciehp_core.c
@@ -374,25 +374,13 @@ static int pciehp_probe(struct pcie_device *dev, const struct pcie_port_service_
374 pciehp_ctrl_list = ctrl; 374 pciehp_ctrl_list = ctrl;
375 } 375 }
376 376
377 /* Wait for exclusive access to hardware */
378 mutex_lock(&ctrl->ctrl_lock);
379
380 t_slot->hpc_ops->get_adapter_status(t_slot, &value); /* Check if slot is occupied */ 377 t_slot->hpc_ops->get_adapter_status(t_slot, &value); /* Check if slot is occupied */
381
382 if ((POWER_CTRL(ctrl->ctrlcap)) && !value) { 378 if ((POWER_CTRL(ctrl->ctrlcap)) && !value) {
383 rc = t_slot->hpc_ops->power_off_slot(t_slot); /* Power off slot if not occupied*/ 379 rc = t_slot->hpc_ops->power_off_slot(t_slot); /* Power off slot if not occupied*/
384 if (rc) { 380 if (rc)
385 /* Done with exclusive hardware access */
386 mutex_unlock(&ctrl->ctrl_lock);
387 goto err_out_free_ctrl_slot; 381 goto err_out_free_ctrl_slot;
388 } else
389 /* Wait for the command to complete */
390 wait_for_ctrl_irq (ctrl);
391 } 382 }
392 383
393 /* Done with exclusive hardware access */
394 mutex_unlock(&ctrl->ctrl_lock);
395
396 return 0; 384 return 0;
397 385
398err_out_free_ctrl_slot: 386err_out_free_ctrl_slot: