Skip to content

Commit e6de161

Browse files
t-8chBenjamin Tissoires
authored andcommitted
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 <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Benjamin Tissoires <[email protected]>
1 parent fe73965 commit e6de161

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/hid/hid-cmedia.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ MODULE_LICENSE("GPL");
2626
/* Fixed report descriptor of HS-100B audio chip
2727
* Bit 4 is an abolute Microphone mute usage instead of being unassigned.
2828
*/
29-
static __u8 hs100b_rdesc_fixed[] = {
29+
static const __u8 hs100b_rdesc_fixed[] = {
3030
0x05, 0x0C, /* Usage Page (Consumer), */
3131
0x09, 0x01, /* Usage (Consumer Control), */
3232
0xA1, 0x01, /* Collection (Application), */
@@ -204,8 +204,8 @@ static const __u8 *cmhid_hs100b_report_fixup(struct hid_device *hid, __u8 *rdesc
204204
{
205205
if (*rsize == HS100B_RDESC_ORIG_SIZE) {
206206
hid_info(hid, "Fixing CMedia HS-100B report descriptor\n");
207-
rdesc = hs100b_rdesc_fixed;
208207
*rsize = sizeof(hs100b_rdesc_fixed);
208+
return hs100b_rdesc_fixed;
209209
}
210210
return rdesc;
211211
}

0 commit comments

Comments
 (0)