summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorDmitry Torokhov <dmitry.torokhov@gmail.com>2026-08-03 11:46:37 -0700
committerJiri Kosina <jkosina@suse.com>2026-08-14 14:46:21 +0200
commit2636afdf4a466c4ea6adc52967a3187dd7ec7072 (patch)
tree4e1d2a2802f208fc3020c71aa27bade1cdfb3134 /include/linux
parent5afaa58f3a3e2878598a0522e8fde345ceb10c1b (diff)
HID: move generic FF initialization into hidinput_connect()
Generic force-feedback initialization (pidff) currently happens in hid_connect() after hidinput_connect() has already registered the input devices. This is racy as the device is live and visible to userspace before FF support is fully set up. Move the call to hdev->ff_init() into hidinput_connect(), ensuring it runs before input_register_device() is called. This closes the race window for standard PID-capable devices. The initialization now also checks (connect_mask & HID_CONNECT_FF) and !hid_has_ff_input() to avoid conflicts with custom FF implementations and respect driver opt-outs. Assisted-by: Gemini:gemini-3.1-pro Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.com>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/hid.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/linux/hid.h b/include/linux/hid.h
index 51b21f98037b..0d046c13eda4 100644
--- a/include/linux/hid.h
+++ b/include/linux/hid.h
@@ -1023,7 +1023,7 @@ extern void hid_unregister_driver(struct hid_driver *);
extern void hidinput_hid_event(struct hid_device *, struct hid_field *, struct hid_usage *, __s32);
extern void hidinput_report_event(struct hid_device *hid, struct hid_report *report);
-extern int hidinput_connect(struct hid_device *hid, unsigned int force);
+extern int hidinput_connect(struct hid_device *hid, unsigned int connect_mask);
extern void hidinput_disconnect(struct hid_device *);
void hidinput_reset_resume(struct hid_device *hid);