summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorThomas Weißschuh <linux@weissschuh.net>2024-08-28 09:33:25 +0200
committerBenjamin Tissoires <bentiss@kernel.org>2024-09-05 16:20:57 +0200
commitc06df4c57af89f07713adc7088ad875409a91462 (patch)
treeaee622aeda4b0f025a69fee376192144ece464b3 /drivers
parentHID: maltron: constify fixed up report descriptor (diff)
downloadlinux-c06df4c57af89f07713adc7088ad875409a91462.tar.xz
linux-c06df4c57af89f07713adc7088ad875409a91462.zip
HID: xiaomi: constify fixed up report descriptor
Now that the HID core can handle const report descriptors, constify them where possible. Signed-off-by: Thomas Weißschuh <linux@weissschuh.net> Link: https://patch.msgid.link/20240828-hid-const-fixup-2-v1-6-663b9210eb69@weissschuh.net Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/hid/hid-xiaomi.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/hid/hid-xiaomi.c b/drivers/hid/hid-xiaomi.c
index 035733fce2e1..ef6598550a40 100644
--- a/drivers/hid/hid-xiaomi.c
+++ b/drivers/hid/hid-xiaomi.c
@@ -14,7 +14,7 @@
/* Fixed Mi Silent Mouse report descriptor */
/* Button's Usage Maximum changed from 3 to 5 to make side buttons work */
#define MI_SILENT_MOUSE_ORIG_RDESC_LENGTH 87
-static __u8 mi_silent_mouse_rdesc_fixed[] = {
+static const __u8 mi_silent_mouse_rdesc_fixed[] = {
0x05, 0x01, /* Usage Page (Desktop), */
0x09, 0x02, /* Usage (Mouse), */
0xA1, 0x01, /* Collection (Application), */
@@ -68,8 +68,8 @@ static const __u8 *xiaomi_report_fixup(struct hid_device *hdev, __u8 *rdesc,
case USB_DEVICE_ID_MI_SILENT_MOUSE:
if (*rsize == MI_SILENT_MOUSE_ORIG_RDESC_LENGTH) {
hid_info(hdev, "fixing up Mi Silent Mouse report descriptor\n");
- rdesc = mi_silent_mouse_rdesc_fixed;
*rsize = sizeof(mi_silent_mouse_rdesc_fixed);
+ return mi_silent_mouse_rdesc_fixed;
}
break;
}