Commit a257090c authored by Mark Brown's avatar Mark Brown Committed by Dmitry Torokhov

Input: ad714x-spi - convert to dev_pm_ops

There is a general move to convert drivers to use dev_pm_ops rather than
bus specific PM operations in order to facilitate core work. Do this
conversion for ad714x-spi.
Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: default avatarMichael Hennerich <michael.hennerich@analog.com>
Signed-off-by: default avatarDmitry Torokhov <dtor@mail.ru>
parent 6b7cfd19
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
#include <linux/input.h> /* BUS_I2C */ #include <linux/input.h> /* BUS_I2C */
#include <linux/module.h> #include <linux/module.h>
#include <linux/spi/spi.h> #include <linux/spi/spi.h>
#include <linux/pm.h>
#include <linux/types.h> #include <linux/types.h>
#include "ad714x.h" #include "ad714x.h"
...@@ -16,20 +17,19 @@ ...@@ -16,20 +17,19 @@
#define AD714x_SPI_READ BIT(10) #define AD714x_SPI_READ BIT(10)
#ifdef CONFIG_PM #ifdef CONFIG_PM
static int ad714x_spi_suspend(struct spi_device *spi, pm_message_t message) static int ad714x_spi_suspend(struct device *dev)
{ {
return ad714x_disable(spi_get_drvdata(spi)); return ad714x_disable(spi_get_drvdata(to_spi_device(dev)));
} }
static int ad714x_spi_resume(struct spi_device *spi) static int ad714x_spi_resume(struct device *dev)
{ {
return ad714x_enable(spi_get_drvdata(spi)); return ad714x_enable(spi_get_drvdata(to_spi_device(dev)));
} }
#else
# define ad714x_spi_suspend NULL
# define ad714x_spi_resume NULL
#endif #endif
static SIMPLE_DEV_PM_OPS(ad714x_spi_pm, ad714x_spi_suspend, ad714x_spi_resume);
static int ad714x_spi_read(struct device *dev, unsigned short reg, static int ad714x_spi_read(struct device *dev, unsigned short reg,
unsigned short *data) unsigned short *data)
{ {
...@@ -79,11 +79,10 @@ static struct spi_driver ad714x_spi_driver = { ...@@ -79,11 +79,10 @@ static struct spi_driver ad714x_spi_driver = {
.driver = { .driver = {
.name = "ad714x_captouch", .name = "ad714x_captouch",
.owner = THIS_MODULE, .owner = THIS_MODULE,
.pm = &ad714x_spi_pm,
}, },
.probe = ad714x_spi_probe, .probe = ad714x_spi_probe,
.remove = __devexit_p(ad714x_spi_remove), .remove = __devexit_p(ad714x_spi_remove),
.suspend = ad714x_spi_suspend,
.resume = ad714x_spi_resume,
}; };
static __init int ad714x_spi_init(void) static __init int ad714x_spi_init(void)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment