diff options
author | Benjamin Tissoires <benjamin.tissoires@redhat.com> | 2022-09-02 16:29:23 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2023-12-08 10:46:08 +0300 |
commit | 2f0ea5e0944a912075c0f943483a36e6dd5aac6f (patch) | |
tree | 1f423fff8a6466666be676e5ef8aa9ecd82be120 /include | |
parent | 650e43dfe7d21f20431edaebec579439275e20c9 (diff) | |
download | linux-2f0ea5e0944a912075c0f943483a36e6dd5aac6f.tar.xz |
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 256f34f49167..7818dbafab0f 100644 --- a/include/linux/hid.h +++ b/include/linux/hid.h @@ -624,6 +624,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) \ |