ACPI: Remove unnecessary from/to-void* and to-void casts in drivers/acpi
[powerpc.git] / drivers / acpi / button.c
index 0259463..fe914eb 100644 (file)
@@ -82,20 +82,19 @@ static struct acpi_driver acpi_button_driver = {
 };
 
 struct acpi_button {
-       acpi_handle handle;
        struct acpi_device *device;     /* Fixed button kludge */
        u8 type;
        unsigned long pushed;
 };
 
-static struct file_operations acpi_button_info_fops = {
+static const struct file_operations acpi_button_info_fops = {
        .open = acpi_button_info_open_fs,
        .read = seq_read,
        .llseek = seq_lseek,
        .release = single_release,
 };
 
-static struct file_operations acpi_button_state_fops = {
+static const struct file_operations acpi_button_state_fops = {
        .open = acpi_button_state_open_fs,
        .read = seq_read,
        .llseek = seq_lseek,
@@ -110,7 +109,7 @@ static struct proc_dir_entry *acpi_button_dir;
 
 static int acpi_button_info_seq_show(struct seq_file *seq, void *offset)
 {
-       struct acpi_button *button = (struct acpi_button *)seq->private;
+       struct acpi_button *button = seq->private;
 
 
        if (!button || !button->device)
@@ -129,7 +128,7 @@ static int acpi_button_info_open_fs(struct inode *inode, struct file *file)
 
 static int acpi_button_state_seq_show(struct seq_file *seq, void *offset)
 {
-       struct acpi_button *button = (struct acpi_button *)seq->private;
+       struct acpi_button *button = seq->private;
        acpi_status status;
        unsigned long state;
 
@@ -137,7 +136,7 @@ static int acpi_button_state_seq_show(struct seq_file *seq, void *offset)
        if (!button || !button->device)
                return 0;
 
-       status = acpi_evaluate_integer(button->handle, "_LID", NULL, &state);
+       status = acpi_evaluate_integer(button->device->handle, "_LID", NULL, &state);
        if (ACPI_FAILURE(status)) {
                seq_printf(seq, "state:      unsupported\n");
        } else {
@@ -254,7 +253,7 @@ static int acpi_button_remove_fs(struct acpi_device *device)
 
 static void acpi_button_notify(acpi_handle handle, u32 event, void *data)
 {
-       struct acpi_button *button = (struct acpi_button *)data;
+       struct acpi_button *button = data;
 
 
        if (!button || !button->device)
@@ -276,13 +275,13 @@ static void acpi_button_notify(acpi_handle handle, u32 event, void *data)
 
 static acpi_status acpi_button_notify_fixed(void *data)
 {
-       struct acpi_button *button = (struct acpi_button *)data;
+       struct acpi_button *button = data;
 
 
        if (!button)
                return AE_BAD_PARAMETER;
 
-       acpi_button_notify(button->handle, ACPI_BUTTON_NOTIFY_STATUS, button);
+       acpi_button_notify(button->device->handle, ACPI_BUTTON_NOTIFY_STATUS, button);
 
        return AE_OK;
 }
@@ -303,7 +302,6 @@ static int acpi_button_add(struct acpi_device *device)
        memset(button, 0, sizeof(struct acpi_button));
 
        button->device = device;
-       button->handle = device->handle;
        acpi_driver_data(device) = button;
 
        /*
@@ -362,7 +360,7 @@ static int acpi_button_add(struct acpi_device *device)
                                                     button);
                break;
        default:
-               status = acpi_install_notify_handler(button->handle,
+               status = acpi_install_notify_handler(device->handle,
                                                     ACPI_DEVICE_NOTIFY,
                                                     acpi_button_notify,
                                                     button);
@@ -420,7 +418,7 @@ static int acpi_button_remove(struct acpi_device *device, int type)
                                                    acpi_button_notify_fixed);
                break;
        default:
-               status = acpi_remove_notify_handler(button->handle,
+               status = acpi_remove_notify_handler(device->handle,
                                                    ACPI_DEVICE_NOTIFY,
                                                    acpi_button_notify);
                break;