diff options
| author | Andrzej Pietrasiewicz <andrzej.p@collabora.com> | 2026-08-04 21:03:36 -0700 |
|---|---|---|
| committer | Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> | 2026-09-16 02:18:37 +0300 |
| commit | d6479c25eceff5bca10c2fadb2088dcae1f53561 (patch) | |
| tree | 2d24165a05ba354343b040e423d213c33ffa5a4b | |
| parent | 8873641968ed5b3d825315baf627f9aebf592860 (diff) | |
| download | linux-next-d6479c25eceff5bca10c2fadb2088dcae1f53561.tar.gz linux-next-d6479c25eceff5bca10c2fadb2088dcae1f53561.zip | |
platform/x86: thinkpad_acpi: Use input_device_enabled()
Use the new helper. Inspecting input device's 'users' member needs to be
done under device's mutex, so add appropriate invocations.
Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@collabora.com>
Acked-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Link: https://lore.kernel.org/r/20200608112211.12125-7-andrzej.p@collabora.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Reviewed-by: Mark Pearson <mpearson-lenovo@squebb.ca>
Link: https://patch.msgid.link/anK1j7hbMyFHGBUS@google.com
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
| -rw-r--r-- | drivers/platform/x86/lenovo/thinkpad_acpi.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/platform/x86/lenovo/thinkpad_acpi.c b/drivers/platform/x86/lenovo/thinkpad_acpi.c index 61a63519a91d..d456add19b30 100644 --- a/drivers/platform/x86/lenovo/thinkpad_acpi.c +++ b/drivers/platform/x86/lenovo/thinkpad_acpi.c @@ -2555,9 +2555,10 @@ static void hotkey_poll_setup(const bool may_warn) lockdep_assert_held(&hotkey_mutex); + mutex_lock(&tpacpi_inputdev->mutex); if (hotkey_poll_freq > 0 && (poll_driver_mask || - (poll_user_mask && tpacpi_inputdev->users > 0))) { + (poll_user_mask && input_device_enabled(tpacpi_inputdev)))) { if (!tpacpi_hotkey_task) { tpacpi_hotkey_task = kthread_run(hotkey_kthread, NULL, TPACPI_NVRAM_KTHREAD_NAME); @@ -2574,6 +2575,7 @@ static void hotkey_poll_setup(const bool may_warn) poll_user_mask, poll_driver_mask); } } + mutex_unlock(&tpacpi_inputdev->mutex); } static void hotkey_poll_setup_safe(const bool may_warn) |
