]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
Input: lpc32xx_ts - use guard notation when acquiring mutex
authorDmitry Torokhov <dmitry.torokhov@gmail.com>
Fri, 16 Aug 2024 21:11:25 +0000 (14:11 -0700)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Wed, 25 Mar 2026 04:14:53 +0000 (21:14 -0700)
Guard notation simplifies code.

Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
drivers/input/touchscreen/lpc32xx_ts.c

index 9bad8b93c0395bd1435f216eae9ac68fa6b24e42..5de752a06b266b1331a619e8339edc416e057586 100644 (file)
@@ -279,7 +279,7 @@ static int lpc32xx_ts_suspend(struct device *dev)
         * avoid calling the TSC stop and start functions as the TSC
         * isn't yet clocked.
         */
-       mutex_lock(&input->mutex);
+       guard(mutex)(&input->mutex);
 
        if (input_device_enabled(input)) {
                if (device_may_wakeup(dev))
@@ -288,8 +288,6 @@ static int lpc32xx_ts_suspend(struct device *dev)
                        lpc32xx_stop_tsc(tsc);
        }
 
-       mutex_unlock(&input->mutex);
-
        return 0;
 }
 
@@ -298,7 +296,7 @@ static int lpc32xx_ts_resume(struct device *dev)
        struct lpc32xx_tsc *tsc = dev_get_drvdata(dev);
        struct input_dev *input = tsc->dev;
 
-       mutex_lock(&input->mutex);
+       guard(mutex)(&input->mutex);
 
        if (input_device_enabled(input)) {
                if (device_may_wakeup(dev))
@@ -307,8 +305,6 @@ static int lpc32xx_ts_resume(struct device *dev)
                        lpc32xx_setup_tsc(tsc);
        }
 
-       mutex_unlock(&input->mutex);
-
        return 0;
 }