]> err.no Git - linux-2.6/blobdiff - drivers/pci/hotplug/acpiphp_glue.c
[PATCH] acpiphp: turn off slot power at error case
[linux-2.6] / drivers / pci / hotplug / acpiphp_glue.c
index 631efce3a6ce98832f87f180996bf3f7e8dd6d26..610a530232ffbe7e5d94b0cde7b49857b07fb748 100644 (file)
@@ -546,7 +546,6 @@ static int add_bridge(acpi_handle handle)
        if (detect_ejectable_slots(handle) > 0) {
                dbg("found PCI host-bus bridge with hot-pluggable slots\n");
                add_host_bridge(handle, pci_bus);
-               return 0;
        }
 
        /* search P2P bridges under this host bridge */
@@ -1593,9 +1592,15 @@ int acpiphp_enable_slot(struct acpiphp_slot *slot)
        if (retval)
                goto err_exit;
 
-       if (get_slot_status(slot) == ACPI_STA_ALL)
+       if (get_slot_status(slot) == ACPI_STA_ALL) {
                /* configure all functions */
                retval = enable_device(slot);
+               if (retval)
+                       power_off_slot(slot);
+       } else {
+               dbg("%s: Slot status is not ACPI_STA_ALL\n", __FUNCTION__);
+               power_off_slot(slot);
+       }
 
  err_exit:
        mutex_unlock(&slot->crit_sect);