X-Git-Url: http://pilppa.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=drivers%2Facpi%2Fcontainer.c;h=871aa520ece78aaa50d94bbb90a29c3c9f4ef83b;hb=9a2239b1174bdf0952a21ed328cd74240d2dd173;hp=27ec12c1fab084c2ea1bba43c24be5e00c636e71;hpb=b3ce1debe2685383a9ad6ace9c49869c3968c013;p=linux-2.6-omap-h63xx.git diff --git a/drivers/acpi/container.c b/drivers/acpi/container.c index 27ec12c1fab..871aa520ece 100644 --- a/drivers/acpi/container.c +++ b/drivers/acpi/container.c @@ -73,17 +73,16 @@ static int is_device_present(acpi_handle handle) acpi_status status; unsigned long sta; - ACPI_FUNCTION_TRACE("is_device_present"); status = acpi_get_handle(handle, "_STA", &temp); if (ACPI_FAILURE(status)) - return_VALUE(1); /* _STA not found, assmue device present */ + return 1; /* _STA not found, assmue device present */ status = acpi_evaluate_integer(handle, "_STA", NULL, &sta); if (ACPI_FAILURE(status)) - return_VALUE(0); /* Firmware error */ + return 0; /* Firmware error */ - return_VALUE((sta & ACPI_STA_PRESENT) == ACPI_STA_PRESENT); + return ((sta & ACPI_STA_PRESENT) == ACPI_STA_PRESENT); } /*******************************************************************/ @@ -91,16 +90,15 @@ static int acpi_container_add(struct acpi_device *device) { struct acpi_container *container; - ACPI_FUNCTION_TRACE("acpi_container_add"); if (!device) { - ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "device is NULL\n")); - return_VALUE(-EINVAL); + printk(KERN_ERR PREFIX "device is NULL\n"); + return -EINVAL; } container = kmalloc(sizeof(struct acpi_container), GFP_KERNEL); if (!container) - return_VALUE(-ENOMEM); + return -ENOMEM; memset(container, 0, sizeof(struct acpi_container)); container->handle = device->handle; @@ -111,7 +109,7 @@ static int acpi_container_add(struct acpi_device *device) ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Device <%s> bid <%s>\n", acpi_device_name(device), acpi_device_bid(device))); - return_VALUE(0); + return 0; } static int acpi_container_remove(struct acpi_device *device, int type) @@ -130,23 +128,22 @@ static int container_device_add(struct acpi_device **device, acpi_handle handle) struct acpi_device *pdev; int result; - ACPI_FUNCTION_TRACE("container_device_add"); if (acpi_get_parent(handle, &phandle)) { - return_VALUE(-ENODEV); + return -ENODEV; } if (acpi_bus_get_device(phandle, &pdev)) { - return_VALUE(-ENODEV); + return -ENODEV; } if (acpi_bus_add(device, pdev, handle, ACPI_BUS_TYPE_DEVICE)) { - return_VALUE(-ENODEV); + return -ENODEV; } result = acpi_bus_start(*device); - return_VALUE(result); + return result; } static void container_notify_cb(acpi_handle handle, u32 type, void *context) @@ -156,7 +153,6 @@ static void container_notify_cb(acpi_handle handle, u32 type, void *context) int present; acpi_status status; - ACPI_FUNCTION_TRACE("container_notify_cb"); present = is_device_present(handle); @@ -172,27 +168,27 @@ static void container_notify_cb(acpi_handle handle, u32 type, void *context) if (ACPI_FAILURE(status) || !device) { result = container_device_add(&device, handle); if (!result) - kobject_hotplug(&device->kobj, - KOBJ_ONLINE); + kobject_uevent(&device->kobj, + KOBJ_ONLINE); else printk("Failed to add container\n"); } } else { if (ACPI_SUCCESS(status)) { /* device exist and this is a remove request */ - kobject_hotplug(&device->kobj, KOBJ_OFFLINE); + kobject_uevent(&device->kobj, KOBJ_OFFLINE); } } break; case ACPI_NOTIFY_EJECT_REQUEST: if (!acpi_bus_get_device(handle, &device) && device) { - kobject_hotplug(&device->kobj, KOBJ_OFFLINE); + kobject_uevent(&device->kobj, KOBJ_OFFLINE); } break; default: break; } - return_VOID; + return; } static acpi_status @@ -205,11 +201,10 @@ container_walk_namespace_cb(acpi_handle handle, acpi_status status; int *action = context; - ACPI_FUNCTION_TRACE("container_walk_namespace_cb"); status = acpi_get_object_info(handle, &buffer); if (ACPI_FAILURE(status) || !buffer.pointer) { - return_ACPI_STATUS(AE_OK); + return AE_OK; } info = buffer.pointer; @@ -241,9 +236,9 @@ container_walk_namespace_cb(acpi_handle handle, } end: - acpi_os_free(buffer.pointer); + kfree(buffer.pointer); - return_ACPI_STATUS(AE_OK); + return AE_OK; } static int __init acpi_container_init(void) @@ -269,7 +264,6 @@ static void __exit acpi_container_exit(void) { int action = UNINSTALL_NOTIFY_HANDLER; - ACPI_FUNCTION_TRACE("acpi_container_exit"); acpi_walk_namespace(ACPI_TYPE_DEVICE, ACPI_ROOT_OBJECT, @@ -278,7 +272,7 @@ static void __exit acpi_container_exit(void) acpi_bus_unregister_driver(&acpi_container_driver); - return_VOID; + return; } module_init(acpi_container_init);