diff options
author | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2013-11-06 19:41:39 -0500 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2013-11-06 19:41:39 -0500 |
commit | 5add99cfef416487d32b4b7075fe1a409f3a5e82 (patch) | |
tree | 29553178aac29acea786fa36576c8b6e0f536623 /drivers/acpi/pci_root.c | |
parent | 2441191a19039002b2c454a261fb45986df15184 (diff) |
ACPI / hotplug: Simplify device ejection routines
Simplify handle_root_bridge_removal() and acpi_eject_store() by
getting rid of struct acpi_eject_event and passing device objects
directly to async routines executed via acpi_os_hotplug_execute().
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Acked-by: Toshi Kani <toshi.kani@hp.com>
Diffstat (limited to 'drivers/acpi/pci_root.c')
-rw-r--r-- | drivers/acpi/pci_root.c | 20 |
1 files changed, 2 insertions, 18 deletions
diff --git a/drivers/acpi/pci_root.c b/drivers/acpi/pci_root.c index d7e53ea53d6c..2c03aaee1006 100644 --- a/drivers/acpi/pci_root.c +++ b/drivers/acpi/pci_root.c | |||
@@ -593,27 +593,11 @@ static void handle_root_bridge_insertion(acpi_handle handle) | |||
593 | static void handle_root_bridge_removal(struct acpi_device *device) | 593 | static void handle_root_bridge_removal(struct acpi_device *device) |
594 | { | 594 | { |
595 | acpi_status status; | 595 | acpi_status status; |
596 | struct acpi_eject_event *ej_event; | ||
597 | |||
598 | ej_event = kmalloc(sizeof(*ej_event), GFP_KERNEL); | ||
599 | if (!ej_event) { | ||
600 | /* Inform firmware the hot-remove operation has error */ | ||
601 | (void) acpi_evaluate_hotplug_ost(device->handle, | ||
602 | ACPI_NOTIFY_EJECT_REQUEST, | ||
603 | ACPI_OST_SC_NON_SPECIFIC_FAILURE, | ||
604 | NULL); | ||
605 | return; | ||
606 | } | ||
607 | |||
608 | ej_event->device = device; | ||
609 | ej_event->event = ACPI_NOTIFY_EJECT_REQUEST; | ||
610 | 596 | ||
611 | get_device(&device->dev); | 597 | get_device(&device->dev); |
612 | status = acpi_os_hotplug_execute(acpi_bus_hot_remove_device, ej_event); | 598 | status = acpi_os_hotplug_execute(acpi_bus_hot_remove_device, device); |
613 | if (ACPI_FAILURE(status)) { | 599 | if (ACPI_FAILURE(status)) |
614 | put_device(&device->dev); | 600 | put_device(&device->dev); |
615 | kfree(ej_event); | ||
616 | } | ||
617 | } | 601 | } |
618 | 602 | ||
619 | static void _handle_hotplug_event_root(struct work_struct *work) | 603 | static void _handle_hotplug_event_root(struct work_struct *work) |