summaryrefslogtreecommitdiff
path: root/drivers/input/touchscreen/melfas_mip4.c
diff options
context:
space:
mode:
authorAndrzej Pietrasiewicz <andrzej.p@collabora.com>2020-10-04 21:16:07 -0700
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2020-12-02 22:10:33 -0800
commitd69f0a43c677e8afc67a222e1e7b51b9acc69cd3 (patch)
tree1b03a8d3ed76cb507f344c85cd0d0c474e6b7fa3 /drivers/input/touchscreen/melfas_mip4.c
parent39be39ceffd572baddfeff8b50aba931d3d6d785 (diff)
Input: use input_device_enabled()
Use the newly added helper in relevant input drivers. Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@collabora.com> Link: https://lore.kernel.org/r/20200608112211.12125-3-andrzej.p@collabora.com Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Diffstat (limited to 'drivers/input/touchscreen/melfas_mip4.c')
-rw-r--r--drivers/input/touchscreen/melfas_mip4.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/input/touchscreen/melfas_mip4.c b/drivers/input/touchscreen/melfas_mip4.c
index f67efdd040b2..c0050044a5a9 100644
--- a/drivers/input/touchscreen/melfas_mip4.c
+++ b/drivers/input/touchscreen/melfas_mip4.c
@@ -1256,7 +1256,7 @@ static int mip4_execute_fw_update(struct mip4_ts *ts, const struct firmware *fw)
if (error)
return error;
- if (ts->input->users) {
+ if (input_device_enabled(ts->input)) {
disable_irq(ts->client->irq);
} else {
error = mip4_power_on(ts);
@@ -1276,7 +1276,7 @@ static int mip4_execute_fw_update(struct mip4_ts *ts, const struct firmware *fw)
"Failed to flash firmware: %d\n", error);
/* Enable IRQ */
- if (ts->input->users)
+ if (input_device_enabled(ts->input))
enable_irq(ts->client->irq);
else
mip4_power_off(ts);
@@ -1539,7 +1539,7 @@ static int __maybe_unused mip4_suspend(struct device *dev)
if (device_may_wakeup(dev))
ts->wake_irq_enabled = enable_irq_wake(client->irq) == 0;
- else if (input->users)
+ else if (input_device_enabled(input))
mip4_disable(ts);
mutex_unlock(&input->mutex);
@@ -1557,7 +1557,7 @@ static int __maybe_unused mip4_resume(struct device *dev)
if (ts->wake_irq_enabled)
disable_irq_wake(client->irq);
- else if (input->users)
+ else if (input_device_enabled(input))
mip4_enable(ts);
mutex_unlock(&input->mutex);