}
/**
- * enable_device - enable, configure a slot
+ * enable_slot - enable, configure a slot
* @slot: slot to be enabled
*
* This function should be called per *physical slot*,
* not per each slot object in ACPI namespace.
*/
-static int __ref enable_device(struct acpiphp_slot *slot)
+static void __ref enable_slot(struct acpiphp_slot *slot)
{
struct pci_dev *dev;
struct pci_bus *bus = slot->bus;
list_for_each_entry(dev, &bus->devices, bus_list) {
if (PCI_SLOT(dev->devfn) != slot->device)
continue;
+
if (dev->hdr_type == PCI_HEADER_TYPE_BRIDGE ||
dev->hdr_type == PCI_HEADER_TYPE_CARDBUS) {
max = pci_scan_bridge(bus, dev, max, pass);
continue;
}
}
-
- return 0;
}
/* return first device in slot, acquiring a reference on it */
}
/**
- * disable_device - disable a slot
+ * disable_slot - disable a slot
* @slot: ACPI PHP slot
*/
-static int disable_device(struct acpiphp_slot *slot)
+static void disable_slot(struct acpiphp_slot *slot)
{
struct acpiphp_func *func;
struct pci_dev *pdev;
/*
- * enable_device() enumerates all functions in this device via
+ * enable_slot() enumerates all functions in this device via
* pci_scan_slot(), whether they have associated ACPI hotplug
* methods (_EJ0, etc.) or not. Therefore, we remove all functions
* here.
acpiphp_bus_trim(func_to_handle(func));
slot->flags &= (~SLOT_ENABLED);
-
- return 0;
}
trim_stale_devices(dev);
/* configure all functions */
- enable_device(slot);
+ enable_slot(slot);
} else {
- disable_device(slot);
+ disable_slot(slot);
}
mutex_unlock(&slot->crit_sect);
}
struct acpiphp_slot *slot = func->slot;
mutex_lock(&slot->crit_sect);
- enable_device(slot);
+ enable_slot(slot);
mutex_unlock(&slot->crit_sect);
}
break;
*/
int acpiphp_enable_slot(struct acpiphp_slot *slot)
{
- int retval = 0;
-
mutex_lock(&slot->crit_sect);
-
/* configure all functions */
if (!(slot->flags & SLOT_ENABLED))
- retval = enable_device(slot);
+ enable_slot(slot);
mutex_unlock(&slot->crit_sect);
- return retval;
+ return 0;
}
/**
mutex_lock(&slot->crit_sect);
/* unconfigure all functions */
- retval = disable_device(slot);
- if (retval)
- goto err_exit;
+ disable_slot(slot);
list_for_each_entry(func, &slot->funcs, sibling)
if (func->flags & FUNC_HAS_EJ0) {
break;
}
- err_exit:
mutex_unlock(&slot->crit_sect);
return retval;
}