diff options
| author | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2011-02-11 12:22:40 -0500 |
|---|---|---|
| committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2011-02-21 04:02:31 -0500 |
| commit | 4d1ac94e2e3cd15f06ffc74efa42d6572fdf7689 (patch) | |
| tree | 5884cb5942b070b204713dc3782120dc5cf56a8f /drivers/input/misc | |
| parent | fbb899356d4a6b6080ab3d9656914938db49449e (diff) | |
Input: adxl34x-spi - convert to dev_pm_ops
There is a general move to convert drivers to use dev_pm_ops rather than
bus specific ones in order to facilitate core development. Do this
conversion for adxl34x-spi.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Diffstat (limited to 'drivers/input/misc')
| -rw-r--r-- | drivers/input/misc/adxl34x-spi.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/drivers/input/misc/adxl34x-spi.c b/drivers/input/misc/adxl34x-spi.c index 782de9e8982..5231add66a6 100644 --- a/drivers/input/misc/adxl34x-spi.c +++ b/drivers/input/misc/adxl34x-spi.c | |||
| @@ -10,6 +10,7 @@ | |||
| 10 | #include <linux/input.h> /* BUS_SPI */ | 10 | #include <linux/input.h> /* BUS_SPI */ |
| 11 | #include <linux/module.h> | 11 | #include <linux/module.h> |
| 12 | #include <linux/spi/spi.h> | 12 | #include <linux/spi/spi.h> |
| 13 | #include <linux/pm.h> | ||
| 13 | #include <linux/types.h> | 14 | #include <linux/types.h> |
| 14 | #include "adxl34x.h" | 15 | #include "adxl34x.h" |
| 15 | 16 | ||
| @@ -94,8 +95,9 @@ static int __devexit adxl34x_spi_remove(struct spi_device *spi) | |||
| 94 | } | 95 | } |
| 95 | 96 | ||
| 96 | #ifdef CONFIG_PM | 97 | #ifdef CONFIG_PM |
| 97 | static int adxl34x_spi_suspend(struct spi_device *spi, pm_message_t message) | 98 | static int adxl34x_spi_suspend(struct device *dev) |
| 98 | { | 99 | { |
| 100 | struct spi_device *spi = to_spi_device(dev); | ||
| 99 | struct adxl34x *ac = dev_get_drvdata(&spi->dev); | 101 | struct adxl34x *ac = dev_get_drvdata(&spi->dev); |
| 100 | 102 | ||
| 101 | adxl34x_suspend(ac); | 103 | adxl34x_suspend(ac); |
| @@ -103,29 +105,29 @@ static int adxl34x_spi_suspend(struct spi_device *spi, pm_message_t message) | |||
| 103 | return 0; | 105 | return 0; |
| 104 | } | 106 | } |
| 105 | 107 | ||
| 106 | static int adxl34x_spi_resume(struct spi_device *spi) | 108 | static int adxl34x_spi_resume(struct device *dev) |
| 107 | { | 109 | { |
| 110 | struct spi_device *spi = to_spi_device(dev); | ||
| 108 | struct adxl34x *ac = dev_get_drvdata(&spi->dev); | 111 | struct adxl34x *ac = dev_get_drvdata(&spi->dev); |
| 109 | 112 | ||
| 110 | adxl34x_resume(ac); | 113 | adxl34x_resume(ac); |
| 111 | 114 | ||
| 112 | return 0; | 115 | return 0; |
| 113 | } | 116 | } |
| 114 | #else | ||
| 115 | # define adxl34x_spi_suspend NULL | ||
| 116 | # define adxl34x_spi_resume NULL | ||
| 117 | #endif | 117 | #endif |
| 118 | 118 | ||
| 119 | static SIMPLE_DEV_PM_OPS(adxl34x_spi_pm, adxl34x_spi_suspend, | ||
| 120 | adxl34x_spi_resume); | ||
| 121 | |||
| 119 | static struct spi_driver adxl34x_driver = { | 122 | static struct spi_driver adxl34x_driver = { |
| 120 | .driver = { | 123 | .driver = { |
| 121 | .name = "adxl34x", | 124 | .name = "adxl34x", |
| 122 | .bus = &spi_bus_type, | 125 | .bus = &spi_bus_type, |
| 123 | .owner = THIS_MODULE, | 126 | .owner = THIS_MODULE, |
| 127 | .pm = &adxl34x_spi_pm, | ||
| 124 | }, | 128 | }, |
| 125 | .probe = adxl34x_spi_probe, | 129 | .probe = adxl34x_spi_probe, |
| 126 | .remove = __devexit_p(adxl34x_spi_remove), | 130 | .remove = __devexit_p(adxl34x_spi_remove), |
| 127 | .suspend = adxl34x_spi_suspend, | ||
| 128 | .resume = adxl34x_spi_resume, | ||
| 129 | }; | 131 | }; |
| 130 | 132 | ||
| 131 | static int __init adxl34x_spi_init(void) | 133 | static int __init adxl34x_spi_init(void) |
