diff options
Diffstat (limited to 'drivers/acpi/button.c')
-rw-r--r-- | drivers/acpi/button.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/drivers/acpi/button.c b/drivers/acpi/button.c index 02594639c4d9..5ef885e82c78 100644 --- a/drivers/acpi/button.c +++ b/drivers/acpi/button.c | |||
@@ -82,20 +82,19 @@ static struct acpi_driver acpi_button_driver = { | |||
82 | }; | 82 | }; |
83 | 83 | ||
84 | struct acpi_button { | 84 | struct acpi_button { |
85 | acpi_handle handle; | ||
86 | struct acpi_device *device; /* Fixed button kludge */ | 85 | struct acpi_device *device; /* Fixed button kludge */ |
87 | u8 type; | 86 | u8 type; |
88 | unsigned long pushed; | 87 | unsigned long pushed; |
89 | }; | 88 | }; |
90 | 89 | ||
91 | static struct file_operations acpi_button_info_fops = { | 90 | static const struct file_operations acpi_button_info_fops = { |
92 | .open = acpi_button_info_open_fs, | 91 | .open = acpi_button_info_open_fs, |
93 | .read = seq_read, | 92 | .read = seq_read, |
94 | .llseek = seq_lseek, | 93 | .llseek = seq_lseek, |
95 | .release = single_release, | 94 | .release = single_release, |
96 | }; | 95 | }; |
97 | 96 | ||
98 | static struct file_operations acpi_button_state_fops = { | 97 | static const struct file_operations acpi_button_state_fops = { |
99 | .open = acpi_button_state_open_fs, | 98 | .open = acpi_button_state_open_fs, |
100 | .read = seq_read, | 99 | .read = seq_read, |
101 | .llseek = seq_lseek, | 100 | .llseek = seq_lseek, |
@@ -137,7 +136,7 @@ static int acpi_button_state_seq_show(struct seq_file *seq, void *offset) | |||
137 | if (!button || !button->device) | 136 | if (!button || !button->device) |
138 | return 0; | 137 | return 0; |
139 | 138 | ||
140 | status = acpi_evaluate_integer(button->handle, "_LID", NULL, &state); | 139 | status = acpi_evaluate_integer(button->device->handle, "_LID", NULL, &state); |
141 | if (ACPI_FAILURE(status)) { | 140 | if (ACPI_FAILURE(status)) { |
142 | seq_printf(seq, "state: unsupported\n"); | 141 | seq_printf(seq, "state: unsupported\n"); |
143 | } else { | 142 | } else { |
@@ -282,7 +281,7 @@ static acpi_status acpi_button_notify_fixed(void *data) | |||
282 | if (!button) | 281 | if (!button) |
283 | return AE_BAD_PARAMETER; | 282 | return AE_BAD_PARAMETER; |
284 | 283 | ||
285 | acpi_button_notify(button->handle, ACPI_BUTTON_NOTIFY_STATUS, button); | 284 | acpi_button_notify(button->device->handle, ACPI_BUTTON_NOTIFY_STATUS, button); |
286 | 285 | ||
287 | return AE_OK; | 286 | return AE_OK; |
288 | } | 287 | } |
@@ -303,7 +302,6 @@ static int acpi_button_add(struct acpi_device *device) | |||
303 | memset(button, 0, sizeof(struct acpi_button)); | 302 | memset(button, 0, sizeof(struct acpi_button)); |
304 | 303 | ||
305 | button->device = device; | 304 | button->device = device; |
306 | button->handle = device->handle; | ||
307 | acpi_driver_data(device) = button; | 305 | acpi_driver_data(device) = button; |
308 | 306 | ||
309 | /* | 307 | /* |
@@ -362,7 +360,7 @@ static int acpi_button_add(struct acpi_device *device) | |||
362 | button); | 360 | button); |
363 | break; | 361 | break; |
364 | default: | 362 | default: |
365 | status = acpi_install_notify_handler(button->handle, | 363 | status = acpi_install_notify_handler(device->handle, |
366 | ACPI_DEVICE_NOTIFY, | 364 | ACPI_DEVICE_NOTIFY, |
367 | acpi_button_notify, | 365 | acpi_button_notify, |
368 | button); | 366 | button); |
@@ -420,7 +418,7 @@ static int acpi_button_remove(struct acpi_device *device, int type) | |||
420 | acpi_button_notify_fixed); | 418 | acpi_button_notify_fixed); |
421 | break; | 419 | break; |
422 | default: | 420 | default: |
423 | status = acpi_remove_notify_handler(button->handle, | 421 | status = acpi_remove_notify_handler(device->handle, |
424 | ACPI_DEVICE_NOTIFY, | 422 | ACPI_DEVICE_NOTIFY, |
425 | acpi_button_notify); | 423 | acpi_button_notify); |
426 | break; | 424 | break; |