diff options
| author | Benjamin Tissoires <benjamin.tissoires@redhat.com> | 2022-09-02 15:29:23 +0200 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2023-12-08 08:43:23 +0100 |
| commit | 218e961e45d3f7b96a8ea857b47640af75abec2a (patch) | |
| tree | 0fa75d4176f3929b8485cea6b4b120f9b43a4fae /include | |
| parent | 6523d0eda97f9c20cd1a61c6134d9290228e9963 (diff) | |
HID: core: store the unique system identifier in hid_device
[ Upstream commit 1e839143d674603b0bbbc4c513bca35404967dbc ]
This unique identifier is currently used only for ensuring uniqueness in
sysfs. However, this could be handful for userspace to refer to a specific
hid_device by this id.
2 use cases are in my mind: LEDs (and their naming convention), and
HID-BPF.
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Link: https://lore.kernel.org/r/20220902132938.2409206-9-benjamin.tissoires@redhat.com
Stable-dep-of: fc43e9c857b7 ("HID: fix HID device resource race between HID core and debugging support")
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'include')
| -rw-r--r-- | include/linux/hid.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/hid.h b/include/linux/hid.h index 79c6c3b4e004..10b41b2b2085 100644 --- a/include/linux/hid.h +++ b/include/linux/hid.h @@ -625,6 +625,8 @@ struct hid_device { /* device report descriptor */ struct list_head debug_list; spinlock_t debug_list_lock; wait_queue_head_t debug_wait; + + unsigned int id; /* system unique id */ }; #define to_hid_device(pdev) \ |
