ACPI: delete unused acpi_device_get_debug_info()
[sfrench/cifs-2.6.git] / drivers / acpi / scan.c
index cac4fcdcfc8d76936108a7554c57b0b0f0584279..2e0fc8c3b58b88612bccdde575714a546e9b9798 100644 (file)
@@ -4,6 +4,7 @@
 
 #include <linux/module.h>
 #include <linux/init.h>
+#include <linux/kernel.h>
 #include <linux/acpi.h>
 
 #include <acpi/acpi_drivers.h>
@@ -113,6 +114,8 @@ static struct kset acpi_namespace_kset = {
 static void acpi_device_register(struct acpi_device *device,
                                 struct acpi_device *parent)
 {
+       int err;
+
        /*
         * Linkage
         * -------
@@ -138,7 +141,10 @@ static void acpi_device_register(struct acpi_device *device,
                device->kobj.parent = &parent->kobj;
        device->kobj.ktype = &ktype_acpi_ns;
        device->kobj.kset = &acpi_namespace_kset;
-       kobject_register(&device->kobj);
+       err = kobject_register(&device->kobj);
+       if (err < 0)
+               printk(KERN_WARNING "%s: kobject_register error: %d\n",
+                       __FUNCTION__, err);
        create_sysfs_device_files(device);
 }
 
@@ -663,6 +669,29 @@ static int acpi_bus_find_driver(struct acpi_device *device)
                                  Device Enumeration
    -------------------------------------------------------------------------- */
 
+acpi_status
+acpi_bus_get_ejd(acpi_handle handle, acpi_handle *ejd)
+{
+       acpi_status status;
+       acpi_handle tmp;
+       struct acpi_buffer buffer = {ACPI_ALLOCATE_BUFFER, NULL};
+       union acpi_object *obj;
+
+       status = acpi_get_handle(handle, "_EJD", &tmp);
+       if (ACPI_FAILURE(status))
+               return status;
+
+       status = acpi_evaluate_object(handle, "_EJD", NULL, &buffer);
+       if (ACPI_SUCCESS(status)) {
+               obj = buffer.pointer;
+               status = acpi_get_handle(NULL, obj->string.pointer, ejd);
+               kfree(buffer.pointer);
+       }
+       return status;
+}
+EXPORT_SYMBOL_GPL(acpi_bus_get_ejd);
+
+
 static int acpi_bus_get_flags(struct acpi_device *device)
 {
        acpi_status status = AE_OK;
@@ -859,49 +888,6 @@ static int acpi_device_set_context(struct acpi_device *device, int type)
        return result;
 }
 
-static void acpi_device_get_debug_info(struct acpi_device *device,
-                                      acpi_handle handle, int type)
-{
-#ifdef CONFIG_ACPI_DEBUG_OUTPUT
-       char *type_string = NULL;
-       char name[80] = { '?', '\0' };
-       struct acpi_buffer buffer = { sizeof(name), name };
-
-       switch (type) {
-       case ACPI_BUS_TYPE_DEVICE:
-               type_string = "Device";
-               acpi_get_name(handle, ACPI_FULL_PATHNAME, &buffer);
-               break;
-       case ACPI_BUS_TYPE_POWER:
-               type_string = "Power Resource";
-               acpi_get_name(handle, ACPI_FULL_PATHNAME, &buffer);
-               break;
-       case ACPI_BUS_TYPE_PROCESSOR:
-               type_string = "Processor";
-               acpi_get_name(handle, ACPI_FULL_PATHNAME, &buffer);
-               break;
-       case ACPI_BUS_TYPE_SYSTEM:
-               type_string = "System";
-               acpi_get_name(handle, ACPI_FULL_PATHNAME, &buffer);
-               break;
-       case ACPI_BUS_TYPE_THERMAL:
-               type_string = "Thermal Zone";
-               acpi_get_name(handle, ACPI_FULL_PATHNAME, &buffer);
-               break;
-       case ACPI_BUS_TYPE_POWER_BUTTON:
-               type_string = "Power Button";
-               sprintf(name, "PWRB");
-               break;
-       case ACPI_BUS_TYPE_SLEEP_BUTTON:
-               type_string = "Sleep Button";
-               sprintf(name, "SLPB");
-               break;
-       }
-
-       printk(KERN_DEBUG "Found %s %s [%p]\n", type_string, name, handle);
-#endif                         /*CONFIG_ACPI_DEBUG_OUTPUT */
-}
-
 static int acpi_bus_remove(struct acpi_device *dev, int rmdevice)
 {
        int result = 0;
@@ -955,12 +941,11 @@ acpi_add_single_object(struct acpi_device **child,
        if (!child)
                return -EINVAL;
 
-       device = kmalloc(sizeof(struct acpi_device), GFP_KERNEL);
+       device = kzalloc(sizeof(struct acpi_device), GFP_KERNEL);
        if (!device) {
                printk(KERN_ERR PREFIX "Memory allocation error\n");
                return -ENOMEM;
        }
-       memset(device, 0, sizeof(struct acpi_device));
 
        device->handle = handle;
        device->parent = parent;
@@ -1048,8 +1033,6 @@ acpi_add_single_object(struct acpi_device **child,
        if ((result = acpi_device_set_context(device, type)))
                goto end;
 
-       acpi_device_get_debug_info(device, handle, type);
-
        acpi_device_register(device, parent);
 
        /*
@@ -1427,7 +1410,9 @@ static int __init acpi_scan_init(void)
        if (acpi_disabled)
                return 0;
 
-       kset_register(&acpi_namespace_kset);
+       result = kset_register(&acpi_namespace_kset);
+       if (result < 0)
+               printk(KERN_ERR PREFIX "kset_register error: %d\n", result);
 
        result = bus_register(&acpi_bus_type);
        if (result) {