aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/acpi/acpi_memhotplug.c2
-rw-r--r--drivers/acpi/container.c2
-rw-r--r--drivers/acpi/dock.c2
-rw-r--r--drivers/acpi/processor_driver.c2
-rw-r--r--drivers/acpi/scan.c54
-rw-r--r--drivers/pci/hotplug/acpiphp_glue.c4
-rw-r--r--drivers/pci/hotplug/sgi_hotplug.c4
-rw-r--r--include/acpi/acpi_bus.h2
8 files changed, 31 insertions, 41 deletions
diff --git a/drivers/acpi/acpi_memhotplug.c b/drivers/acpi/acpi_memhotplug.c
index eaddb7a89c70..15ea22fc1f5e 100644
--- a/drivers/acpi/acpi_memhotplug.c
+++ b/drivers/acpi/acpi_memhotplug.c
@@ -167,7 +167,7 @@ acpi_memory_get_device(acpi_handle handle,
167 * Now add the notified device. This creates the acpi_device 167 * Now add the notified device. This creates the acpi_device
168 * and invokes .add function 168 * and invokes .add function
169 */ 169 */
170 result = acpi_bus_add(handle); 170 result = acpi_bus_scan(handle);
171 if (result) { 171 if (result) {
172 acpi_handle_warn(handle, "Cannot add acpi bus\n"); 172 acpi_handle_warn(handle, "Cannot add acpi bus\n");
173 return -EINVAL; 173 return -EINVAL;
diff --git a/drivers/acpi/container.c b/drivers/acpi/container.c
index f8fb2281f34a..cc79d3e53a39 100644
--- a/drivers/acpi/container.c
+++ b/drivers/acpi/container.c
@@ -166,7 +166,7 @@ static void container_notify_cb(acpi_handle handle, u32 type, void *context)
166 if (!ACPI_FAILURE(status) || device) 166 if (!ACPI_FAILURE(status) || device)
167 break; 167 break;
168 168
169 result = acpi_bus_add(handle); 169 result = acpi_bus_scan(handle);
170 if (result) { 170 if (result) {
171 acpi_handle_warn(handle, "Failed to add container\n"); 171 acpi_handle_warn(handle, "Failed to add container\n");
172 break; 172 break;
diff --git a/drivers/acpi/dock.c b/drivers/acpi/dock.c
index 4a56a8b2e51e..420d24fc9388 100644
--- a/drivers/acpi/dock.c
+++ b/drivers/acpi/dock.c
@@ -317,7 +317,7 @@ static struct acpi_device * dock_create_acpi_device(acpi_handle handle)
317 * no device created for this object, 317 * no device created for this object,
318 * so we should create one. 318 * so we should create one.
319 */ 319 */
320 ret = acpi_bus_add(handle); 320 ret = acpi_bus_scan(handle);
321 if (ret) 321 if (ret)
322 pr_debug("error adding bus, %x\n", -ret); 322 pr_debug("error adding bus, %x\n", -ret);
323 323
diff --git a/drivers/acpi/processor_driver.c b/drivers/acpi/processor_driver.c
index a24ee43e06e4..9c5929a17d3a 100644
--- a/drivers/acpi/processor_driver.c
+++ b/drivers/acpi/processor_driver.c
@@ -699,7 +699,7 @@ static void acpi_processor_hotplug_notify(acpi_handle handle,
699 if (!acpi_bus_get_device(handle, &device)) 699 if (!acpi_bus_get_device(handle, &device))
700 break; 700 break;
701 701
702 result = acpi_bus_add(handle); 702 result = acpi_bus_scan(handle);
703 if (result) { 703 if (result) {
704 acpi_handle_err(handle, "Unable to add the device\n"); 704 acpi_handle_err(handle, "Unable to add the device\n");
705 break; 705 break;
diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c
index 388b59c096dc..7c43bdc36abc 100644
--- a/drivers/acpi/scan.c
+++ b/drivers/acpi/scan.c
@@ -1577,26 +1577,8 @@ static acpi_status acpi_bus_device_attach(acpi_handle handle, u32 lvl_not_used,
1577 return status; 1577 return status;
1578} 1578}
1579 1579
1580static int acpi_bus_scan(acpi_handle handle)
1581{
1582 void *device = NULL;
1583
1584 if (ACPI_SUCCESS(acpi_bus_check_add(handle, 0, NULL, &device)))
1585 acpi_walk_namespace(ACPI_TYPE_ANY, handle, ACPI_UINT32_MAX,
1586 acpi_bus_check_add, NULL, NULL, &device);
1587
1588 if (!device)
1589 return -ENODEV;
1590
1591 if (ACPI_SUCCESS(acpi_bus_device_attach(handle, 0, NULL, NULL)))
1592 acpi_walk_namespace(ACPI_TYPE_ANY, handle, ACPI_UINT32_MAX,
1593 acpi_bus_device_attach, NULL, NULL, NULL);
1594
1595 return 0;
1596}
1597
1598/** 1580/**
1599 * acpi_bus_add - Add ACPI device node objects in a given namespace scope. 1581 * acpi_bus_scan - Add ACPI device node objects in a given namespace scope.
1600 * @handle: Root of the namespace scope to scan. 1582 * @handle: Root of the namespace scope to scan.
1601 * 1583 *
1602 * Scan a given ACPI tree (probably recently hot-plugged) and create and add 1584 * Scan a given ACPI tree (probably recently hot-plugged) and create and add
@@ -1607,18 +1589,24 @@ static int acpi_bus_scan(acpi_handle handle)
1607 * in the table trunk from which the kernel could create a device and add an 1589 * in the table trunk from which the kernel could create a device and add an
1608 * appropriate driver. 1590 * appropriate driver.
1609 */ 1591 */
1610int acpi_bus_add(acpi_handle handle) 1592int acpi_bus_scan(acpi_handle handle)
1611{ 1593{
1612 int err; 1594 void *device = NULL;
1613 1595
1614 err = acpi_bus_scan(handle); 1596 if (ACPI_SUCCESS(acpi_bus_check_add(handle, 0, NULL, &device)))
1615 if (err) 1597 acpi_walk_namespace(ACPI_TYPE_ANY, handle, ACPI_UINT32_MAX,
1616 return err; 1598 acpi_bus_check_add, NULL, NULL, &device);
1599
1600 if (!device)
1601 return -ENODEV;
1602
1603 if (ACPI_SUCCESS(acpi_bus_device_attach(handle, 0, NULL, NULL)))
1604 acpi_walk_namespace(ACPI_TYPE_ANY, handle, ACPI_UINT32_MAX,
1605 acpi_bus_device_attach, NULL, NULL, NULL);
1617 1606
1618 acpi_update_all_gpes();
1619 return 0; 1607 return 0;
1620} 1608}
1621EXPORT_SYMBOL(acpi_bus_add); 1609EXPORT_SYMBOL(acpi_bus_scan);
1622 1610
1623static acpi_status acpi_bus_device_detach(acpi_handle handle, u32 lvl_not_used, 1611static acpi_status acpi_bus_device_detach(acpi_handle handle, u32 lvl_not_used,
1624 void *not_used, void **ret_not_used) 1612 void *not_used, void **ret_not_used)
@@ -1708,13 +1696,15 @@ int __init acpi_scan_init(void)
1708 return result; 1696 return result;
1709 1697
1710 result = acpi_bus_get_device(ACPI_ROOT_OBJECT, &acpi_root); 1698 result = acpi_bus_get_device(ACPI_ROOT_OBJECT, &acpi_root);
1711 if (!result)
1712 result = acpi_bus_scan_fixed();
1713
1714 if (result) 1699 if (result)
1700 return result;
1701
1702 result = acpi_bus_scan_fixed();
1703 if (result) {
1715 acpi_device_unregister(acpi_root); 1704 acpi_device_unregister(acpi_root);
1716 else 1705 return result;
1717 acpi_update_all_gpes(); 1706 }
1718 1707
1719 return result; 1708 acpi_update_all_gpes();
1709 return 0;
1720} 1710}
diff --git a/drivers/pci/hotplug/acpiphp_glue.c b/drivers/pci/hotplug/acpiphp_glue.c
index 22006f2d9dd5..9e2b1f6dbe41 100644
--- a/drivers/pci/hotplug/acpiphp_glue.c
+++ b/drivers/pci/hotplug/acpiphp_glue.c
@@ -746,7 +746,7 @@ static int acpiphp_bus_add(struct acpiphp_func *func)
746 dbg("acpi_bus_trim return %x\n", ret_val); 746 dbg("acpi_bus_trim return %x\n", ret_val);
747 } 747 }
748 748
749 ret_val = acpi_bus_add(func->handle); 749 ret_val = acpi_bus_scan(func->handle);
750 if (!ret_val) 750 if (!ret_val)
751 ret_val = acpi_bus_get_device(func->handle, &device); 751 ret_val = acpi_bus_get_device(func->handle, &device);
752 752
@@ -1129,7 +1129,7 @@ static void handle_bridge_insertion(acpi_handle handle, u32 type)
1129 return; 1129 return;
1130 } 1130 }
1131 1131
1132 if (acpi_bus_add(handle)) { 1132 if (acpi_bus_scan(handle)) {
1133 err("cannot add bridge to acpi list\n"); 1133 err("cannot add bridge to acpi list\n");
1134 return; 1134 return;
1135 } 1135 }
diff --git a/drivers/pci/hotplug/sgi_hotplug.c b/drivers/pci/hotplug/sgi_hotplug.c
index 2e006ee5738b..ae606b3e991e 100644
--- a/drivers/pci/hotplug/sgi_hotplug.c
+++ b/drivers/pci/hotplug/sgi_hotplug.c
@@ -447,9 +447,9 @@ static int enable_slot(struct hotplug_slot *bss_hotplug_slot)
447 if (ACPI_SUCCESS(ret) && 447 if (ACPI_SUCCESS(ret) &&
448 (adr>>16) == (slot->device_num + 1)) { 448 (adr>>16) == (slot->device_num + 1)) {
449 449
450 ret = acpi_bus_add(chandle); 450 ret = acpi_bus_scan(chandle);
451 if (ACPI_FAILURE(ret)) { 451 if (ACPI_FAILURE(ret)) {
452 printk(KERN_ERR "%s: acpi_bus_add " 452 printk(KERN_ERR "%s: acpi_bus_scan "
453 "failed (0x%x) for slot %d " 453 "failed (0x%x) for slot %d "
454 "func %d\n", __func__, 454 "func %d\n", __func__,
455 ret, (int)(adr>>16), 455 ret, (int)(adr>>16),
diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h
index 567851b4f043..2c722deb2490 100644
--- a/include/acpi/acpi_bus.h
+++ b/include/acpi/acpi_bus.h
@@ -346,7 +346,7 @@ static inline int acpi_bus_generate_proc_event(struct acpi_device *device, u8 ty
346#endif 346#endif
347int acpi_bus_register_driver(struct acpi_driver *driver); 347int acpi_bus_register_driver(struct acpi_driver *driver);
348void acpi_bus_unregister_driver(struct acpi_driver *driver); 348void acpi_bus_unregister_driver(struct acpi_driver *driver);
349int acpi_bus_add(acpi_handle handle); 349int acpi_bus_scan(acpi_handle handle);
350void acpi_bus_hot_remove_device(void *context); 350void acpi_bus_hot_remove_device(void *context);
351int acpi_bus_trim(struct acpi_device *start); 351int acpi_bus_trim(struct acpi_device *start);
352acpi_status acpi_bus_get_ejd(acpi_handle handle, acpi_handle * ejd); 352acpi_status acpi_bus_get_ejd(acpi_handle handle, acpi_handle * ejd);