summaryrefslogtreecommitdiff
path: root/drivers/input/touchscreen
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/input/touchscreen')
-rw-r--r--drivers/input/touchscreen/bu21029_ts.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/input/touchscreen/bu21029_ts.c b/drivers/input/touchscreen/bu21029_ts.c
index 64f474e67312..68d9cd55ceeb 100644
--- a/drivers/input/touchscreen/bu21029_ts.c
+++ b/drivers/input/touchscreen/bu21029_ts.c
@@ -416,10 +416,10 @@ static int bu21029_suspend(struct device *dev)
struct bu21029_ts_data *bu21029 = i2c_get_clientdata(i2c);
if (!device_may_wakeup(dev)) {
- mutex_lock(&bu21029->in_dev->mutex);
+ guard(mutex)(&bu21029->in_dev->mutex);
+
if (input_device_enabled(bu21029->in_dev))
bu21029_stop_chip(bu21029->in_dev);
- mutex_unlock(&bu21029->in_dev->mutex);
}
return 0;
@@ -431,10 +431,10 @@ static int bu21029_resume(struct device *dev)
struct bu21029_ts_data *bu21029 = i2c_get_clientdata(i2c);
if (!device_may_wakeup(dev)) {
- mutex_lock(&bu21029->in_dev->mutex);
+ guard(mutex)(&bu21029->in_dev->mutex);
+
if (input_device_enabled(bu21029->in_dev))
bu21029_start_chip(bu21029->in_dev);
- mutex_unlock(&bu21029->in_dev->mutex);
}
return 0;