diff options
author | Rafael J. Wysocki <rjw@sisk.pl> | 2012-06-27 17:27:40 -0400 |
---|---|---|
committer | Rafael J. Wysocki <rjw@sisk.pl> | 2012-07-01 07:31:04 -0400 |
commit | a7377419624c31d71e35485251f8548c728d5999 (patch) | |
tree | 093784ca3d5180df872323f266af41f284ef62c3 | |
parent | bb6b98d6e4f9aada309c54ebd6df1cc6151f3af1 (diff) |
panasonic-laptop: Use struct dev_pm_ops for power management
Make the panasonic-laptop driver define its PM callbacks through
a struct dev_pm_ops object rather than by using legacy PM hooks
in struct acpi_device_ops.
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-rw-r--r-- | drivers/platform/x86/panasonic-laptop.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/drivers/platform/x86/panasonic-laptop.c b/drivers/platform/x86/panasonic-laptop.c index ffff8b4b4949..24480074bcf0 100644 --- a/drivers/platform/x86/panasonic-laptop.c +++ b/drivers/platform/x86/panasonic-laptop.c | |||
@@ -177,7 +177,6 @@ enum SINF_BITS { SINF_NUM_BATTERIES = 0, | |||
177 | 177 | ||
178 | static int acpi_pcc_hotkey_add(struct acpi_device *device); | 178 | static int acpi_pcc_hotkey_add(struct acpi_device *device); |
179 | static int acpi_pcc_hotkey_remove(struct acpi_device *device, int type); | 179 | static int acpi_pcc_hotkey_remove(struct acpi_device *device, int type); |
180 | static int acpi_pcc_hotkey_resume(struct acpi_device *device); | ||
181 | static void acpi_pcc_hotkey_notify(struct acpi_device *device, u32 event); | 180 | static void acpi_pcc_hotkey_notify(struct acpi_device *device, u32 event); |
182 | 181 | ||
183 | static const struct acpi_device_id pcc_device_ids[] = { | 182 | static const struct acpi_device_id pcc_device_ids[] = { |
@@ -189,6 +188,9 @@ static const struct acpi_device_id pcc_device_ids[] = { | |||
189 | }; | 188 | }; |
190 | MODULE_DEVICE_TABLE(acpi, pcc_device_ids); | 189 | MODULE_DEVICE_TABLE(acpi, pcc_device_ids); |
191 | 190 | ||
191 | static int acpi_pcc_hotkey_resume(struct device *dev); | ||
192 | static SIMPLE_DEV_PM_OPS(acpi_pcc_hotkey_pm, NULL, acpi_pcc_hotkey_resume); | ||
193 | |||
192 | static struct acpi_driver acpi_pcc_driver = { | 194 | static struct acpi_driver acpi_pcc_driver = { |
193 | .name = ACPI_PCC_DRIVER_NAME, | 195 | .name = ACPI_PCC_DRIVER_NAME, |
194 | .class = ACPI_PCC_CLASS, | 196 | .class = ACPI_PCC_CLASS, |
@@ -196,9 +198,9 @@ static struct acpi_driver acpi_pcc_driver = { | |||
196 | .ops = { | 198 | .ops = { |
197 | .add = acpi_pcc_hotkey_add, | 199 | .add = acpi_pcc_hotkey_add, |
198 | .remove = acpi_pcc_hotkey_remove, | 200 | .remove = acpi_pcc_hotkey_remove, |
199 | .resume = acpi_pcc_hotkey_resume, | ||
200 | .notify = acpi_pcc_hotkey_notify, | 201 | .notify = acpi_pcc_hotkey_notify, |
201 | }, | 202 | }, |
203 | .drv.pm = &acpi_pcc_hotkey_pm, | ||
202 | }; | 204 | }; |
203 | 205 | ||
204 | static const struct key_entry panasonic_keymap[] = { | 206 | static const struct key_entry panasonic_keymap[] = { |
@@ -538,11 +540,15 @@ static void acpi_pcc_destroy_input(struct pcc_acpi *pcc) | |||
538 | 540 | ||
539 | /* kernel module interface */ | 541 | /* kernel module interface */ |
540 | 542 | ||
541 | static int acpi_pcc_hotkey_resume(struct acpi_device *device) | 543 | static int acpi_pcc_hotkey_resume(struct device *dev) |
542 | { | 544 | { |
543 | struct pcc_acpi *pcc = acpi_driver_data(device); | 545 | struct pcc_acpi *pcc; |
546 | |||
547 | if (!dev) | ||
548 | return -EINVAL; | ||
544 | 549 | ||
545 | if (device == NULL || pcc == NULL) | 550 | pcc = acpi_driver_data(to_acpi_device(dev)); |
551 | if (!pcc) | ||
546 | return -EINVAL; | 552 | return -EINVAL; |
547 | 553 | ||
548 | ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Sticky mode restore: %d\n", | 554 | ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Sticky mode restore: %d\n", |