Merge branches 'acpi-video' and 'acpi-hotplug'
[cascardo/linux.git] / drivers / pci / hotplug / acpiphp_glue.c
index ff53856..fa49f91 100644 (file)
@@ -707,7 +707,7 @@ static void acpiphp_sanitize_bus(struct pci_bus *bus)
        unsigned long type_mask = IORESOURCE_IO | IORESOURCE_MEM;
 
        list_for_each_entry_safe_reverse(dev, tmp, &bus->devices, bus_list) {
-               for (i=0; i<PCI_BRIDGE_RESOURCES; i++) {
+               for (i = 0; i < PCI_BRIDGE_RESOURCES; i++) {
                        struct resource *res = &dev->resource[i];
                        if ((res->flags & type_mask) && !res->start &&
                                        res->end) {
@@ -953,8 +953,10 @@ int acpiphp_enable_slot(struct acpiphp_slot *slot)
 {
        pci_lock_rescan_remove();
 
-       if (slot->flags & SLOT_IS_GOING_AWAY)
+       if (slot->flags & SLOT_IS_GOING_AWAY) {
+               pci_unlock_rescan_remove();
                return -ENODEV;
+       }
 
        /* configure all functions */
        if (!(slot->flags & SLOT_ENABLED))