Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Input: omap4-keypad - use guard notation when acquiring mutex

This makes the code more compact and error handling more robust
by ensuring that mutexes are released in all code paths when control
leaves critical section.

Link: https://lore.kernel.org/r/20240825051627.2848495-13-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>

+1 -3
+1 -3
drivers/input/keyboard/omap4-keypad.c
··· 144 144 { 145 145 u64 changed; 146 146 147 - mutex_lock(&keypad_data->lock); 147 + guard(mutex)(&keypad_data->lock); 148 148 149 149 changed = keys ^ keypad_data->keys; 150 150 ··· 158 158 omap4_keypad_report_keys(keypad_data, changed & keys, true); 159 159 160 160 keypad_data->keys = keys; 161 - 162 - mutex_unlock(&keypad_data->lock); 163 161 } 164 162 165 163 /* Interrupt handlers */