diff options
author | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2011-07-09 15:41:46 -0400 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2011-07-10 19:08:32 -0400 |
commit | bdda82162837a20e591ac01b306dc8f052270510 (patch) | |
tree | db5317c0f906897085b81df45ff881ffd8087449 /drivers/input | |
parent | fd05d08920b54d189aa247c5c5701a08e539ed0b (diff) |
Input: gpio_keys - switch to using SIMPLE_DEV_PM_OPS
This reduces amount #ifdeds in the code.
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Diffstat (limited to 'drivers/input')
-rw-r--r-- | drivers/input/keyboard/gpio_keys.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/drivers/input/keyboard/gpio_keys.c b/drivers/input/keyboard/gpio_keys.c index ad11e8647261..ce281d152275 100644 --- a/drivers/input/keyboard/gpio_keys.c +++ b/drivers/input/keyboard/gpio_keys.c | |||
@@ -693,7 +693,7 @@ static int __devexit gpio_keys_remove(struct platform_device *pdev) | |||
693 | return 0; | 693 | return 0; |
694 | } | 694 | } |
695 | 695 | ||
696 | #ifdef CONFIG_PM | 696 | #ifdef CONFIG_PM_SLEEP |
697 | static int gpio_keys_suspend(struct device *dev) | 697 | static int gpio_keys_suspend(struct device *dev) |
698 | { | 698 | { |
699 | struct gpio_keys_drvdata *ddata = dev_get_drvdata(dev); | 699 | struct gpio_keys_drvdata *ddata = dev_get_drvdata(dev); |
@@ -731,22 +731,17 @@ static int gpio_keys_resume(struct device *dev) | |||
731 | 731 | ||
732 | return 0; | 732 | return 0; |
733 | } | 733 | } |
734 | |||
735 | static const struct dev_pm_ops gpio_keys_pm_ops = { | ||
736 | .suspend = gpio_keys_suspend, | ||
737 | .resume = gpio_keys_resume, | ||
738 | }; | ||
739 | #endif | 734 | #endif |
740 | 735 | ||
736 | static SIMPLE_DEV_PM_OPS(gpio_keys_pm_ops, gpio_keys_suspend, gpio_keys_resume); | ||
737 | |||
741 | static struct platform_driver gpio_keys_device_driver = { | 738 | static struct platform_driver gpio_keys_device_driver = { |
742 | .probe = gpio_keys_probe, | 739 | .probe = gpio_keys_probe, |
743 | .remove = __devexit_p(gpio_keys_remove), | 740 | .remove = __devexit_p(gpio_keys_remove), |
744 | .driver = { | 741 | .driver = { |
745 | .name = "gpio-keys", | 742 | .name = "gpio-keys", |
746 | .owner = THIS_MODULE, | 743 | .owner = THIS_MODULE, |
747 | #ifdef CONFIG_PM | ||
748 | .pm = &gpio_keys_pm_ops, | 744 | .pm = &gpio_keys_pm_ops, |
749 | #endif | ||
750 | .of_match_table = gpio_keys_of_match, | 745 | .of_match_table = gpio_keys_of_match, |
751 | } | 746 | } |
752 | }; | 747 | }; |