diff options
author | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2011-03-17 01:08:26 -0400 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2011-03-17 02:28:04 -0400 |
commit | 3ff8ff53aae7b7e46dec6a50c29b8a022ec299ba (patch) | |
tree | 722afcf322ccd8c1ac3bf1c7c05f3b0f0245488d /drivers | |
parent | 6b007d62fabb279b51c784c7c8abc6848b66a917 (diff) |
Input: tsc2005 - convert to using dev_pm_ops
Newer code should not be using legacy suspend/resume methods but
rather supply dev_pm_ops structure as it allows better control
over power management.
Tested-by: Aaro Koskinen <aaro.koskinen@nokia.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/input/touchscreen/tsc2005.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/drivers/input/touchscreen/tsc2005.c b/drivers/input/touchscreen/tsc2005.c index 5dad30a4b153..109efbffe5ad 100644 --- a/drivers/input/touchscreen/tsc2005.c +++ b/drivers/input/touchscreen/tsc2005.c | |||
@@ -27,6 +27,7 @@ | |||
27 | #include <linux/input.h> | 27 | #include <linux/input.h> |
28 | #include <linux/interrupt.h> | 28 | #include <linux/interrupt.h> |
29 | #include <linux/delay.h> | 29 | #include <linux/delay.h> |
30 | #include <linux/pm.h> | ||
30 | #include <linux/spi/spi.h> | 31 | #include <linux/spi/spi.h> |
31 | #include <linux/spi/tsc2005.h> | 32 | #include <linux/spi/tsc2005.h> |
32 | 33 | ||
@@ -661,8 +662,8 @@ static int __devexit tsc2005_remove(struct spi_device *spi) | |||
661 | return 0; | 662 | return 0; |
662 | } | 663 | } |
663 | 664 | ||
664 | #ifdef CONFIG_PM | 665 | #ifdef CONFIG_PM_SLEEP |
665 | static int tsc2005_suspend(struct spi_device *spi, pm_message_t mesg) | 666 | static int tsc2005_suspend(struct device *dev) |
666 | { | 667 | { |
667 | struct spi_device *spi = to_spi_device(dev); | 668 | struct spi_device *spi = to_spi_device(dev); |
668 | struct tsc2005 *ts = spi_get_drvdata(spi); | 669 | struct tsc2005 *ts = spi_get_drvdata(spi); |
@@ -674,7 +675,7 @@ static int tsc2005_suspend(struct spi_device *spi, pm_message_t mesg) | |||
674 | return 0; | 675 | return 0; |
675 | } | 676 | } |
676 | 677 | ||
677 | static int tsc2005_resume(struct spi_device *spi) | 678 | static int tsc2005_resume(struct device *dev) |
678 | { | 679 | { |
679 | struct spi_device *spi = to_spi_device(dev); | 680 | struct spi_device *spi = to_spi_device(dev); |
680 | struct tsc2005 *ts = spi_get_drvdata(spi); | 681 | struct tsc2005 *ts = spi_get_drvdata(spi); |
@@ -687,17 +688,16 @@ static int tsc2005_resume(struct spi_device *spi) | |||
687 | } | 688 | } |
688 | #endif | 689 | #endif |
689 | 690 | ||
691 | static SIMPLE_DEV_PM_OPS(tsc2005_pm_ops, tsc2005_suspend, tsc2005_resume); | ||
692 | |||
690 | static struct spi_driver tsc2005_driver = { | 693 | static struct spi_driver tsc2005_driver = { |
691 | .driver = { | 694 | .driver = { |
692 | .name = "tsc2005", | 695 | .name = "tsc2005", |
693 | .owner = THIS_MODULE, | 696 | .owner = THIS_MODULE, |
697 | .pm = &tsc2005_pm_ops, | ||
694 | }, | 698 | }, |
695 | #ifdef CONFIG_PM | 699 | .probe = tsc2005_probe, |
696 | .suspend = tsc2005_suspend, | 700 | .remove = __devexit_p(tsc2005_remove), |
697 | .resume = tsc2005_resume, | ||
698 | #endif | ||
699 | .probe = tsc2005_probe, | ||
700 | .remove = __devexit_p(tsc2005_remove), | ||
701 | }; | 701 | }; |
702 | 702 | ||
703 | static int __init tsc2005_init(void) | 703 | static int __init tsc2005_init(void) |