aboutsummaryrefslogtreecommitdiff
path: root/drivers/acpi/scan.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/acpi/scan.c')
-rw-r--r--drivers/acpi/scan.c59
1 files changed, 24 insertions, 35 deletions
diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c
index 9801837876b..a4a2595b6d8 100644
--- a/drivers/acpi/scan.c
+++ b/drivers/acpi/scan.c
@@ -641,8 +641,7 @@ static int acpi_device_probe(struct device * dev)
ret = acpi_device_install_notify_handler(acpi_dev);
if (ret) {
if (acpi_drv->ops.remove)
- acpi_drv->ops.remove(acpi_dev,
- acpi_dev->removal_type);
+ acpi_drv->ops.remove(acpi_dev);
return ret;
}
}
@@ -664,7 +663,7 @@ static int acpi_device_remove(struct device * dev)
if (acpi_drv->ops.notify)
acpi_device_remove_notify_handler(acpi_dev);
if (acpi_drv->ops.remove)
- acpi_drv->ops.remove(acpi_dev, acpi_dev->removal_type);
+ acpi_drv->ops.remove(acpi_dev);
}
acpi_dev->driver = NULL;
acpi_dev->driver_data = NULL;
@@ -1603,26 +1602,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
@@ -1633,18 +1614,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)
@@ -1733,13 +1720,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;
}