@@ -2671,9 +2671,10 @@ static void hotkey_poll_setup(const bool may_warn)
const u32 poll_driver_mask = hotkey_driver_mask & hotkey_source_mask;
const u32 poll_user_mask = hotkey_user_mask & hotkey_source_mask;
+ 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);
@@ -2690,6 +2691,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)