Input: ads7846 - stop updating dev->power.power_state
This stops the ads7846 driver from using dev->power.power_state; that field is
deprecated (overdue for removal) and the only reason to update it was to make
the /sys/devices/.../power/state files (now removed) work better.
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
diff --git a/drivers/input/touchscreen/ads7846.c b/drivers/input/touchscreen/ads7846.c
index f59aecf..1c08ecc5 100644
--- a/drivers/input/touchscreen/ads7846.c
+++ b/drivers/input/touchscreen/ads7846.c
@@ -116,6 +116,7 @@
// FIXME remove "irq_disabled"
unsigned irq_disabled:1; /* P: lock */
unsigned disabled:1;
+ unsigned is_suspended:1;
int (*filter)(void *data, int data_idx, int *val);
void *filter_data;
@@ -203,7 +204,7 @@
static int device_suspended(struct device *dev)
{
struct ads7846 *ts = dev_get_drvdata(dev);
- return dev->power.power_state.event != PM_EVENT_ON || ts->disabled;
+ return ts->is_suspended || ts->disabled;
}
static int ads7846_read12_ser(struct device *dev, unsigned command)
@@ -795,7 +796,7 @@
spin_lock_irq(&ts->lock);
- spi->dev.power.power_state = message;
+ ts->is_suspended = 1;
ads7846_disable(ts);
spin_unlock_irq(&ts->lock);
@@ -810,7 +811,7 @@
spin_lock_irq(&ts->lock);
- spi->dev.power.power_state = PMSG_ON;
+ ts->is_suspended = 0;
ads7846_enable(ts);
spin_unlock_irq(&ts->lock);
@@ -872,7 +873,6 @@
}
dev_set_drvdata(&spi->dev, ts);
- spi->dev.power.power_state = PMSG_ON;
ts->spi = spi;
ts->input = input_dev;