Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 350849
b: refs/heads/master
c: b8bd759
h: refs/heads/master
i:
  350847: 21bf59e
v: v3
  • Loading branch information
Rafael J. Wysocki committed Jan 19, 2013
1 parent 727e4fa commit eb6c6bf
Show file tree
Hide file tree
Showing 9 changed files with 32 additions and 42 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: 5993c4670ea2453ef5abb45b312f150e994e6eb9
refs/heads/master: b8bd759acd05281abf88cddef30c57313c109697
2 changes: 1 addition & 1 deletion trunk/drivers/acpi/acpi_memhotplug.c
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ acpi_memory_get_device(acpi_handle handle,
* Now add the notified device. This creates the acpi_device
* and invokes .add function
*/
result = acpi_bus_add(handle);
result = acpi_bus_scan(handle);
if (result) {
acpi_handle_warn(handle, "Cannot add acpi bus\n");
return -EINVAL;
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/acpi/container.c
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ static void container_notify_cb(acpi_handle handle, u32 type, void *context)
if (!ACPI_FAILURE(status) || device)
break;

result = acpi_bus_add(handle);
result = acpi_bus_scan(handle);
if (result) {
acpi_handle_warn(handle, "Failed to add container\n");
break;
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/acpi/dock.c
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ static struct acpi_device * dock_create_acpi_device(acpi_handle handle)
* no device created for this object,
* so we should create one.
*/
ret = acpi_bus_add(handle);
ret = acpi_bus_scan(handle);
if (ret)
pr_debug("error adding bus, %x\n", -ret);

Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/acpi/processor_driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -699,7 +699,7 @@ static void acpi_processor_hotplug_notify(acpi_handle handle,
if (!acpi_bus_get_device(handle, &device))
break;

result = acpi_bus_add(handle);
result = acpi_bus_scan(handle);
if (result) {
acpi_handle_err(handle, "Unable to add the device\n");
break;
Expand Down
54 changes: 22 additions & 32 deletions trunk/drivers/acpi/scan.c
Original file line number Diff line number Diff line change
Expand Up @@ -1577,26 +1577,8 @@ static acpi_status acpi_bus_device_attach(acpi_handle handle, u32 lvl_not_used,
return status;
}

static int acpi_bus_scan(acpi_handle handle)
{
void *device = NULL;

if (ACPI_SUCCESS(acpi_bus_check_add(handle, 0, NULL, &device)))
acpi_walk_namespace(ACPI_TYPE_ANY, handle, ACPI_UINT32_MAX,
acpi_bus_check_add, NULL, NULL, &device);

if (!device)
return -ENODEV;

if (ACPI_SUCCESS(acpi_bus_device_attach(handle, 0, NULL, NULL)))
acpi_walk_namespace(ACPI_TYPE_ANY, handle, ACPI_UINT32_MAX,
acpi_bus_device_attach, NULL, NULL, NULL);

return 0;
}

/**
* acpi_bus_add - Add ACPI device node objects in a given namespace scope.
* acpi_bus_scan - Add ACPI device node objects in a given namespace scope.
* @handle: Root of the namespace scope to scan.
*
* Scan a given ACPI tree (probably recently hot-plugged) and create and add
Expand All @@ -1607,18 +1589,24 @@ static int acpi_bus_scan(acpi_handle handle)
* in the table trunk from which the kernel could create a device and add an
* appropriate driver.
*/
int acpi_bus_add(acpi_handle handle)
int acpi_bus_scan(acpi_handle handle)
{
int err;
void *device = NULL;

err = acpi_bus_scan(handle);
if (err)
return err;
if (ACPI_SUCCESS(acpi_bus_check_add(handle, 0, NULL, &device)))
acpi_walk_namespace(ACPI_TYPE_ANY, handle, ACPI_UINT32_MAX,
acpi_bus_check_add, NULL, NULL, &device);

if (!device)
return -ENODEV;

if (ACPI_SUCCESS(acpi_bus_device_attach(handle, 0, NULL, NULL)))
acpi_walk_namespace(ACPI_TYPE_ANY, handle, ACPI_UINT32_MAX,
acpi_bus_device_attach, NULL, NULL, NULL);

acpi_update_all_gpes();
return 0;
}
EXPORT_SYMBOL(acpi_bus_add);
EXPORT_SYMBOL(acpi_bus_scan);

static acpi_status acpi_bus_device_detach(acpi_handle handle, u32 lvl_not_used,
void *not_used, void **ret_not_used)
Expand Down Expand Up @@ -1708,13 +1696,15 @@ int __init acpi_scan_init(void)
return result;

result = acpi_bus_get_device(ACPI_ROOT_OBJECT, &acpi_root);
if (!result)
result = acpi_bus_scan_fixed();

if (result)
return result;

result = acpi_bus_scan_fixed();
if (result) {
acpi_device_unregister(acpi_root);
else
acpi_update_all_gpes();
return result;
}

return result;
acpi_update_all_gpes();
return 0;
}
4 changes: 2 additions & 2 deletions trunk/drivers/pci/hotplug/acpiphp_glue.c
Original file line number Diff line number Diff line change
Expand Up @@ -746,7 +746,7 @@ static int acpiphp_bus_add(struct acpiphp_func *func)
dbg("acpi_bus_trim return %x\n", ret_val);
}

ret_val = acpi_bus_add(func->handle);
ret_val = acpi_bus_scan(func->handle);
if (!ret_val)
ret_val = acpi_bus_get_device(func->handle, &device);

Expand Down Expand Up @@ -1129,7 +1129,7 @@ static void handle_bridge_insertion(acpi_handle handle, u32 type)
return;
}

if (acpi_bus_add(handle)) {
if (acpi_bus_scan(handle)) {
err("cannot add bridge to acpi list\n");
return;
}
Expand Down
4 changes: 2 additions & 2 deletions trunk/drivers/pci/hotplug/sgi_hotplug.c
Original file line number Diff line number Diff line change
Expand Up @@ -447,9 +447,9 @@ static int enable_slot(struct hotplug_slot *bss_hotplug_slot)
if (ACPI_SUCCESS(ret) &&
(adr>>16) == (slot->device_num + 1)) {

ret = acpi_bus_add(chandle);
ret = acpi_bus_scan(chandle);
if (ACPI_FAILURE(ret)) {
printk(KERN_ERR "%s: acpi_bus_add "
printk(KERN_ERR "%s: acpi_bus_scan "
"failed (0x%x) for slot %d "
"func %d\n", __func__,
ret, (int)(adr>>16),
Expand Down
2 changes: 1 addition & 1 deletion trunk/include/acpi/acpi_bus.h
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ static inline int acpi_bus_generate_proc_event(struct acpi_device *device, u8 ty
#endif
int acpi_bus_register_driver(struct acpi_driver *driver);
void acpi_bus_unregister_driver(struct acpi_driver *driver);
int acpi_bus_add(acpi_handle handle);
int acpi_bus_scan(acpi_handle handle);
void acpi_bus_hot_remove_device(void *context);
int acpi_bus_trim(struct acpi_device *start);
acpi_status acpi_bus_get_ejd(acpi_handle handle, acpi_handle * ejd);
Expand Down

0 comments on commit eb6c6bf

Please sign in to comment.