leds: ledtrig-tty: Replace mutex with completion
authorFlorian Eckert <fe@dev.tdt.de>
Mon, 27 Nov 2023 11:03:09 +0000 (12:03 +0100)
committerLee Jones <lee@kernel.org>
Wed, 13 Dec 2023 11:28:48 +0000 (11:28 +0000)
commit76675f69bed5f1e8ae44ba72904ff7f97aa95c0a
tree8c6e60a7f7e3f6450593c10899b48e9495201739
parent4ff4379ce6eefe81695bcc2e021ce1dac3d707d2
leds: ledtrig-tty: Replace mutex with completion

With this commit, the mutex handling is replaced by the completion
handling. When handling mutex, it must always be ensured that the held
mutex is also released again. This is more error-prone should the number
of code paths increase.

This is a preparatory commit to make the trigger more configurable via
additional sysfs parameters. With this change, the worker always runs and
is no longer stopped if no ttyname is set.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Link: https://lore.kernel.org/r/20231127110311.3583957-3-fe@dev.tdt.de
Signed-off-by: Lee Jones <lee@kernel.org>
drivers/leds/trigger/ledtrig-tty.c