summaryrefslogtreecommitdiffstats
path: root/drivers/hid
diff options
context:
space:
mode:
authorThomas Weißschuh <linux@weissschuh.net>2024-08-03 14:34:23 +0200
committerBenjamin Tissoires <bentiss@kernel.org>2024-08-27 16:30:43 +0200
commite6de161b5ab4315405f4001736c25a070def61c7 (patch)
treec495d96ae007f6e3bbc009b059ebb69dee685de0 /drivers/hid
parentHID: change return type of report_fixup() to const (diff)
downloadlinux-e6de161b5ab4315405f4001736c25a070def61c7.tar.xz
linux-e6de161b5ab4315405f4001736c25a070def61c7.zip
HID: cmedia: constify fixed up report descriptor
The HID core now allows static report descriptors to be read-only, make use of it. Signed-off-by: Thomas Weißschuh <linux@weissschuh.net> Link: https://patch.msgid.link/20240803-hid-const-fixup-v2-7-f53d7a7b29d8@weissschuh.net Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
Diffstat (limited to 'drivers/hid')
-rw-r--r--drivers/hid/hid-cmedia.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/hid/hid-cmedia.c b/drivers/hid/hid-cmedia.c
index 01009c95613c..528d7f361215 100644
--- a/drivers/hid/hid-cmedia.c
+++ b/drivers/hid/hid-cmedia.c
@@ -26,7 +26,7 @@ MODULE_LICENSE("GPL");
/* Fixed report descriptor of HS-100B audio chip
* Bit 4 is an abolute Microphone mute usage instead of being unassigned.
*/
-static __u8 hs100b_rdesc_fixed[] = {
+static const __u8 hs100b_rdesc_fixed[] = {
0x05, 0x0C, /* Usage Page (Consumer), */
0x09, 0x01, /* Usage (Consumer Control), */
0xA1, 0x01, /* Collection (Application), */
@@ -204,8 +204,8 @@ static const __u8 *cmhid_hs100b_report_fixup(struct hid_device *hid, __u8 *rdesc
{
if (*rsize == HS100B_RDESC_ORIG_SIZE) {
hid_info(hid, "Fixing CMedia HS-100B report descriptor\n");
- rdesc = hs100b_rdesc_fixed;
*rsize = sizeof(hs100b_rdesc_fixed);
+ return hs100b_rdesc_fixed;
}
return rdesc;
}