diff options
author | Rafael J. Wysocki <rjw@sisk.pl> | 2012-06-27 17:27:33 -0400 |
---|---|---|
committer | Rafael J. Wysocki <rjw@sisk.pl> | 2012-07-01 07:31:04 -0400 |
commit | bb6b98d6e4f9aada309c54ebd6df1cc6151f3af1 (patch) | |
tree | dfe31dd19eea8a13a3a77e666ba76cfcff170b53 /drivers | |
parent | 4ce05b42603195386fa783c4f070ecc8682c189f (diff) |
sony-laptop: Use struct dev_pm_ops for power management
Make the sony-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>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/platform/x86/sony-laptop.c | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/drivers/platform/x86/sony-laptop.c b/drivers/platform/x86/sony-laptop.c index 2b604f376fdb..c7a236240785 100644 --- a/drivers/platform/x86/sony-laptop.c +++ b/drivers/platform/x86/sony-laptop.c | |||
@@ -1452,7 +1452,7 @@ static void sony_nc_function_resume(void) | |||
1452 | &result); | 1452 | &result); |
1453 | } | 1453 | } |
1454 | 1454 | ||
1455 | static int sony_nc_resume(struct acpi_device *device) | 1455 | static int sony_nc_resume(struct device *dev) |
1456 | { | 1456 | { |
1457 | struct sony_nc_value *item; | 1457 | struct sony_nc_value *item; |
1458 | acpi_handle handle; | 1458 | acpi_handle handle; |
@@ -1484,6 +1484,8 @@ static int sony_nc_resume(struct acpi_device *device) | |||
1484 | return 0; | 1484 | return 0; |
1485 | } | 1485 | } |
1486 | 1486 | ||
1487 | static SIMPLE_DEV_PM_OPS(sony_nc_pm, NULL, sony_nc_resume); | ||
1488 | |||
1487 | static void sony_nc_rfkill_cleanup(void) | 1489 | static void sony_nc_rfkill_cleanup(void) |
1488 | { | 1490 | { |
1489 | int i; | 1491 | int i; |
@@ -2728,9 +2730,9 @@ static struct acpi_driver sony_nc_driver = { | |||
2728 | .ops = { | 2730 | .ops = { |
2729 | .add = sony_nc_add, | 2731 | .add = sony_nc_add, |
2730 | .remove = sony_nc_remove, | 2732 | .remove = sony_nc_remove, |
2731 | .resume = sony_nc_resume, | ||
2732 | .notify = sony_nc_notify, | 2733 | .notify = sony_nc_notify, |
2733 | }, | 2734 | }, |
2735 | .drv.pm = &sony_nc_pm, | ||
2734 | }; | 2736 | }; |
2735 | 2737 | ||
2736 | /*********** SPIC (SNY6001) Device ***********/ | 2738 | /*********** SPIC (SNY6001) Device ***********/ |
@@ -4243,19 +4245,22 @@ err_free_resources: | |||
4243 | return result; | 4245 | return result; |
4244 | } | 4246 | } |
4245 | 4247 | ||
4246 | static int sony_pic_suspend(struct acpi_device *device) | 4248 | static int sony_pic_suspend(struct device *dev) |
4247 | { | 4249 | { |
4248 | if (sony_pic_disable(device)) | 4250 | if (sony_pic_disable(to_acpi_device(dev))) |
4249 | return -ENXIO; | 4251 | return -ENXIO; |
4250 | return 0; | 4252 | return 0; |
4251 | } | 4253 | } |
4252 | 4254 | ||
4253 | static int sony_pic_resume(struct acpi_device *device) | 4255 | static int sony_pic_resume(struct device *dev) |
4254 | { | 4256 | { |
4255 | sony_pic_enable(device, spic_dev.cur_ioport, spic_dev.cur_irq); | 4257 | sony_pic_enable(to_acpi_device(dev), |
4258 | spic_dev.cur_ioport, spic_dev.cur_irq); | ||
4256 | return 0; | 4259 | return 0; |
4257 | } | 4260 | } |
4258 | 4261 | ||
4262 | static SIMPLE_DEV_PM_OPS(sony_pic_pm, sony_pic_suspend, sony_pic_resume); | ||
4263 | |||
4259 | static const struct acpi_device_id sony_pic_device_ids[] = { | 4264 | static const struct acpi_device_id sony_pic_device_ids[] = { |
4260 | {SONY_PIC_HID, 0}, | 4265 | {SONY_PIC_HID, 0}, |
4261 | {"", 0}, | 4266 | {"", 0}, |
@@ -4269,9 +4274,8 @@ static struct acpi_driver sony_pic_driver = { | |||
4269 | .ops = { | 4274 | .ops = { |
4270 | .add = sony_pic_add, | 4275 | .add = sony_pic_add, |
4271 | .remove = sony_pic_remove, | 4276 | .remove = sony_pic_remove, |
4272 | .suspend = sony_pic_suspend, | ||
4273 | .resume = sony_pic_resume, | ||
4274 | }, | 4277 | }, |
4278 | .drv.pm = &sony_pic_pm, | ||
4275 | }; | 4279 | }; |
4276 | 4280 | ||
4277 | static struct dmi_system_id __initdata sonypi_dmi_table[] = { | 4281 | static struct dmi_system_id __initdata sonypi_dmi_table[] = { |