summaryrefslogtreecommitdiff
path: root/drivers/input/touchscreen/ad7879.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/input/touchscreen/ad7879.c')
-rw-r--r--drivers/input/touchscreen/ad7879.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/input/touchscreen/ad7879.c b/drivers/input/touchscreen/ad7879.c
index 556a2af46e18..e850853328f1 100644
--- a/drivers/input/touchscreen/ad7879.c
+++ b/drivers/input/touchscreen/ad7879.c
@@ -306,7 +306,7 @@ static int __maybe_unused ad7879_suspend(struct device *dev)
mutex_lock(&ts->input->mutex);
- if (!ts->suspended && !ts->disabled && ts->input->users)
+ if (!ts->suspended && !ts->disabled && input_device_enabled(ts->input))
__ad7879_disable(ts);
ts->suspended = true;
@@ -322,7 +322,7 @@ static int __maybe_unused ad7879_resume(struct device *dev)
mutex_lock(&ts->input->mutex);
- if (ts->suspended && !ts->disabled && ts->input->users)
+ if (ts->suspended && !ts->disabled && input_device_enabled(ts->input))
__ad7879_enable(ts);
ts->suspended = false;
@@ -339,7 +339,7 @@ static void ad7879_toggle(struct ad7879 *ts, bool disable)
{
mutex_lock(&ts->input->mutex);
- if (!ts->suspended && ts->input->users != 0) {
+ if (!ts->suspended && input_device_enabled(ts->input)) {
if (disable) {
if (ts->disabled)