Skip to content

Commit 795b318

Browse files
author
Jiri Kosina
committed
Merge branch 'for-6.15/steam' into for-linus
- code cleanup (Vicki Pfau)
2 parents 82931ba + 41ab653 commit 795b318

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

drivers/hid/hid-steam.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -559,15 +559,13 @@ static void steam_set_lizard_mode(struct steam_device *steam, bool enable)
559559
if (steam->gamepad_mode)
560560
enable = false;
561561

562+
mutex_lock(&steam->report_mutex);
562563
if (enable) {
563-
mutex_lock(&steam->report_mutex);
564564
/* enable esc, enter, cursors */
565565
steam_send_report_byte(steam, ID_SET_DEFAULT_DIGITAL_MAPPINGS);
566566
/* reset settings */
567567
steam_send_report_byte(steam, ID_LOAD_DEFAULT_SETTINGS);
568-
mutex_unlock(&steam->report_mutex);
569568
} else {
570-
mutex_lock(&steam->report_mutex);
571569
/* disable esc, enter, cursor */
572570
steam_send_report_byte(steam, ID_CLEAR_DIGITAL_MAPPINGS);
573571

@@ -579,15 +577,14 @@ static void steam_set_lizard_mode(struct steam_device *steam, bool enable)
579577
SETTING_RIGHT_TRACKPAD_CLICK_PRESSURE, 0xFFFF, /* disable haptic click */
580578
SETTING_STEAM_WATCHDOG_ENABLE, 0, /* disable watchdog that tests if Steam is active */
581579
0);
582-
mutex_unlock(&steam->report_mutex);
583580
} else {
584581
steam_write_settings(steam,
585582
SETTING_LEFT_TRACKPAD_MODE, TRACKPAD_NONE, /* disable mouse */
586583
SETTING_RIGHT_TRACKPAD_MODE, TRACKPAD_NONE, /* disable mouse */
587584
0);
588-
mutex_unlock(&steam->report_mutex);
589585
}
590586
}
587+
mutex_unlock(&steam->report_mutex);
591588
}
592589

593590
static int steam_input_open(struct input_dev *dev)

0 commit comments

Comments
 (0)