diff options
Diffstat (limited to 'drivers/pci/hotplug/acpiphp_glue.c')
| -rw-r--r-- | drivers/pci/hotplug/acpiphp_glue.c | 49 | 
1 files changed, 19 insertions, 30 deletions
diff --git a/drivers/pci/hotplug/acpiphp_glue.c b/drivers/pci/hotplug/acpiphp_glue.c index 602d153c7055..6cd5160fc057 100644 --- a/drivers/pci/hotplug/acpiphp_glue.c +++ b/drivers/pci/hotplug/acpiphp_glue.c @@ -80,8 +80,9 @@ static struct acpiphp_context *acpiphp_init_context(struct acpi_device *adev)  		return NULL;  	context->refcount = 1; -	acpi_set_hp_context(adev, &context->hp, acpiphp_hotplug_notify, NULL, -			    acpiphp_post_dock_fixup); +	context->hp.notify = acpiphp_hotplug_notify; +	context->hp.fixup = acpiphp_post_dock_fixup; +	acpi_set_hp_context(adev, &context->hp);  	return context;  } @@ -369,20 +370,6 @@ static acpi_status acpiphp_add_context(acpi_handle handle, u32 lvl, void *data,  	return AE_OK;  } -static struct acpiphp_bridge *acpiphp_dev_to_bridge(struct acpi_device *adev) -{ -	struct acpiphp_bridge *bridge = NULL; - -	acpi_lock_hp_context(); -	if (adev->hp) { -		bridge = to_acpiphp_root_context(adev->hp)->root_bridge; -		if (bridge) -			get_bridge(bridge); -	} -	acpi_unlock_hp_context(); -	return bridge; -} -  static void cleanup_bridge(struct acpiphp_bridge *bridge)  {  	struct acpiphp_slot *slot; @@ -573,19 +560,15 @@ static void disable_slot(struct acpiphp_slot *slot)  	slot->flags &= (~SLOT_ENABLED);  } -static bool acpiphp_no_hotplug(struct acpi_device *adev) -{ -	return adev && adev->flags.no_hotplug; -} -  static bool slot_no_hotplug(struct acpiphp_slot *slot)  { -	struct acpiphp_func *func; +	struct pci_bus *bus = slot->bus; +	struct pci_dev *dev; -	list_for_each_entry(func, &slot->funcs, sibling) -		if (acpiphp_no_hotplug(func_to_acpi_device(func))) +	list_for_each_entry(dev, &bus->devices, bus_list) { +		if (PCI_SLOT(dev->devfn) == slot->device && dev->ignore_hotplug)  			return true; - +	}  	return false;  } @@ -658,7 +641,7 @@ static void trim_stale_devices(struct pci_dev *dev)  		status = acpi_evaluate_integer(adev->handle, "_STA", NULL, &sta);  		alive = (ACPI_SUCCESS(status) && device_status_valid(sta)) -			|| acpiphp_no_hotplug(adev); +			|| dev->ignore_hotplug;  	}  	if (!alive)  		alive = pci_device_is_present(dev); @@ -753,9 +736,15 @@ static void acpiphp_sanitize_bus(struct pci_bus *bus)  void acpiphp_check_host_bridge(struct acpi_device *adev)  { -	struct acpiphp_bridge *bridge; +	struct acpiphp_bridge *bridge = NULL; -	bridge = acpiphp_dev_to_bridge(adev); +	acpi_lock_hp_context(); +	if (adev->hp) { +		bridge = to_acpiphp_root_context(adev->hp)->root_bridge; +		if (bridge) +			get_bridge(bridge); +	} +	acpi_unlock_hp_context();  	if (bridge) {  		pci_lock_rescan_remove(); @@ -884,7 +873,7 @@ void acpiphp_enumerate_slots(struct pci_bus *bus)  			goto err;  		root_context->root_bridge = bridge; -		acpi_set_hp_context(adev, &root_context->hp, NULL, NULL, NULL); +		acpi_set_hp_context(adev, &root_context->hp);  	} else {  		struct acpiphp_context *context; @@ -927,7 +916,7 @@ void acpiphp_enumerate_slots(struct pci_bus *bus)  	kfree(bridge);  } -void acpiphp_drop_bridge(struct acpiphp_bridge *bridge) +static void acpiphp_drop_bridge(struct acpiphp_bridge *bridge)  {  	if (pci_is_root_bus(bridge->pci_bus)) {  		struct acpiphp_root_context *root_context;  |