aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hid
diff options
context:
space:
mode:
authorJiri Kosina <jkosina@suse.com>2025-03-26 13:55:44 +0100
committerJiri Kosina <jkosina@suse.com>2025-03-26 13:55:44 +0100
commit795b318f0577e380292a1fb794f706a95fed225d (patch)
treebf450aecad106d6db559ca9d1091705f6db109ce /drivers/hid
parentMerge branch 'for-6.15/sony' into for-linus (diff)
parentHID: hid-steam: Mutex cleanup in steam_set_lizard_mode() (diff)
downloadlinux-rng-795b318f0577e380292a1fb794f706a95fed225d.tar.xz
linux-rng-795b318f0577e380292a1fb794f706a95fed225d.zip
Merge branch 'for-6.15/steam' into for-linus
- code cleanup (Vicki Pfau)
Diffstat (limited to 'drivers/hid')
-rw-r--r--drivers/hid/hid-steam.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/drivers/hid/hid-steam.c b/drivers/hid/hid-steam.c
index 10460b7bde1a..dfd9d22ed559 100644
--- a/drivers/hid/hid-steam.c
+++ b/drivers/hid/hid-steam.c
@@ -559,15 +559,13 @@ static void steam_set_lizard_mode(struct steam_device *steam, bool enable)
if (steam->gamepad_mode)
enable = false;
+ mutex_lock(&steam->report_mutex);
if (enable) {
- mutex_lock(&steam->report_mutex);
/* enable esc, enter, cursors */
steam_send_report_byte(steam, ID_SET_DEFAULT_DIGITAL_MAPPINGS);
/* reset settings */
steam_send_report_byte(steam, ID_LOAD_DEFAULT_SETTINGS);
- mutex_unlock(&steam->report_mutex);
} else {
- mutex_lock(&steam->report_mutex);
/* disable esc, enter, cursor */
steam_send_report_byte(steam, ID_CLEAR_DIGITAL_MAPPINGS);
@@ -579,15 +577,14 @@ static void steam_set_lizard_mode(struct steam_device *steam, bool enable)
SETTING_RIGHT_TRACKPAD_CLICK_PRESSURE, 0xFFFF, /* disable haptic click */
SETTING_STEAM_WATCHDOG_ENABLE, 0, /* disable watchdog that tests if Steam is active */
0);
- mutex_unlock(&steam->report_mutex);
} else {
steam_write_settings(steam,
SETTING_LEFT_TRACKPAD_MODE, TRACKPAD_NONE, /* disable mouse */
SETTING_RIGHT_TRACKPAD_MODE, TRACKPAD_NONE, /* disable mouse */
0);
- mutex_unlock(&steam->report_mutex);
}
}
+ mutex_unlock(&steam->report_mutex);
}
static int steam_input_open(struct input_dev *dev)