Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 350980
b: refs/heads/master
c: f058cdf
h: refs/heads/master
v: v3
  • Loading branch information
Rafael J. Wysocki committed Feb 13, 2013
1 parent 4e4d7a0 commit 49898eb
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 15 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 87d4a4da7353c8582049dab50b880798d88ff9d7
refs/heads/master: f058cdf4cf3e5181172455f90fc73f2127b6ddf8
31 changes: 17 additions & 14 deletions trunk/drivers/acpi/scan.c
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@ acpi_device_modalias_show(struct device *dev, struct device_attribute *attr, cha
}
static DEVICE_ATTR(modalias, 0444, acpi_device_modalias_show, NULL);

static void __acpi_bus_trim(struct acpi_device *start);

/**
* acpi_bus_hot_remove_device: hot-remove a device and its children
* @context: struct acpi_eject_event pointer (freed in this func)
Expand All @@ -114,10 +116,12 @@ void acpi_bus_hot_remove_device(void *context)
acpi_status status = AE_OK;
u32 ost_code = ACPI_OST_SC_NON_SPECIFIC_FAILURE; /* default */

mutex_lock(&acpi_scan_lock);

ACPI_DEBUG_PRINT((ACPI_DB_INFO,
"Hot-removing device %s...\n", dev_name(&device->dev)));

acpi_bus_trim(device);
__acpi_bus_trim(device);
/* Device node has been released. */
device = NULL;

Expand Down Expand Up @@ -146,18 +150,14 @@ void acpi_bus_hot_remove_device(void *context)
status = acpi_evaluate_object(handle, "_EJ0", &arg_list, NULL);
if (ACPI_FAILURE(status)) {
if (status != AE_NOT_FOUND)
printk(KERN_WARNING PREFIX
"Eject device failed\n");
goto err_out;
}
acpi_handle_warn(handle, "Eject failed\n");

kfree(context);
return;
/* Tell the firmware the hot-remove operation has failed. */
acpi_evaluate_hotplug_ost(handle, ej_event->event,
ost_code, NULL);
}

err_out:
/* Inform firmware the hot-remove operation has completed w/ error */
(void) acpi_evaluate_hotplug_ost(handle,
ej_event->event, ost_code, NULL);
mutex_unlock(&acpi_scan_lock);
kfree(context);
return;
}
Expand Down Expand Up @@ -1683,10 +1683,8 @@ static acpi_status acpi_bus_remove(acpi_handle handle, u32 lvl_not_used,
return AE_OK;
}

void acpi_bus_trim(struct acpi_device *start)
static void __acpi_bus_trim(struct acpi_device *start)
{
mutex_lock(&acpi_scan_lock);

/*
* Execute acpi_bus_device_detach() as a post-order callback to detach
* all ACPI drivers from the device nodes being removed.
Expand All @@ -1701,7 +1699,12 @@ void acpi_bus_trim(struct acpi_device *start)
acpi_walk_namespace(ACPI_TYPE_ANY, start->handle, ACPI_UINT32_MAX, NULL,
acpi_bus_remove, NULL, NULL);
acpi_bus_remove(start->handle, 0, NULL, NULL);
}

void acpi_bus_trim(struct acpi_device *start)
{
mutex_lock(&acpi_scan_lock);
__acpi_bus_trim(start);
mutex_unlock(&acpi_scan_lock);
}
EXPORT_SYMBOL_GPL(acpi_bus_trim);
Expand Down

0 comments on commit 49898eb

Please sign in to comment.