[PATCH] mark struct file_operations const 3
[powerpc.git] / drivers / acpi / container.c
index 7f7e41d..69a68fd 100644 (file)
@@ -96,11 +96,10 @@ static int acpi_container_add(struct acpi_device *device)
                return -EINVAL;
        }
 
-       container = kmalloc(sizeof(struct acpi_container), GFP_KERNEL);
+       container = kzalloc(sizeof(struct acpi_container), GFP_KERNEL);
        if (!container)
                return -ENOMEM;
 
-       memset(container, 0, sizeof(struct acpi_container));
        container->handle = device->handle;
        strcpy(acpi_device_name(device), ACPI_CONTAINER_DEVICE_NAME);
        strcpy(acpi_device_class(device), ACPI_CONTAINER_CLASS);
@@ -117,7 +116,7 @@ static int acpi_container_remove(struct acpi_device *device, int type)
        acpi_status status = AE_OK;
        struct acpi_container *pc = NULL;
 
-       pc = (struct acpi_container *)acpi_driver_data(device);
+       pc = acpi_driver_data(device);
        kfree(pc);
        return status;
 }
@@ -168,7 +167,7 @@ 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_uevent(&device->kobj,
+                                       kobject_uevent(&device->dev.kobj,
                                                       KOBJ_ONLINE);
                                else
                                        printk("Failed to add container\n");
@@ -176,13 +175,13 @@ static void container_notify_cb(acpi_handle handle, u32 type, void *context)
                } else {
                        if (ACPI_SUCCESS(status)) {
                                /* device exist and this is a remove request */
-                               kobject_uevent(&device->kobj, KOBJ_OFFLINE);
+                               kobject_uevent(&device->dev.kobj, KOBJ_OFFLINE);
                        }
                }
                break;
        case ACPI_NOTIFY_EJECT_REQUEST:
                if (!acpi_bus_get_device(handle, &device) && device) {
-                       kobject_uevent(&device->kobj, KOBJ_OFFLINE);
+                       kobject_uevent(&device->dev.kobj, KOBJ_OFFLINE);
                }
                break;
        default:
@@ -236,7 +235,7 @@ container_walk_namespace_cb(acpi_handle handle,
        }
 
       end:
-       acpi_os_free(buffer.pointer);
+       kfree(buffer.pointer);
 
        return AE_OK;
 }