SPDX-FileCopyrightText: 2024 Gábor Stefanik SPDX-License-Identifier: GPL-2.0-only Name the union in i2c_hid_desc_override, to avoid unknown field error --- drivers/hid/i2c-hid/i2c-hid-dmi-quirks.c.bak 2024-02-15 13:27:20.177877726 +0100 +++ drivers/hid/i2c-hid/i2c-hid-dmi-quirks.c 2024-02-15 15:11:15.787482938 +0100 @@ -18,7 +18,7 @@ union { struct i2c_hid_desc *i2c_hid_desc; uint8_t *i2c_hid_desc_buffer; - }; + } u; uint8_t *hid_report_desc; unsigned int hid_report_desc_size; uint8_t *i2c_name; @@ -36,6 +36,7 @@ */ static const struct i2c_hid_desc_override sipodev_desc = { + .u = { .i2c_hid_desc_buffer = (uint8_t []) {0x1e, 0x00, /* Length of descriptor */ 0x00, 0x01, /* Version of descriptor */ @@ -52,6 +53,7 @@ 0x06, 0x00, /* Version ID */ 0x00, 0x00, 0x00, 0x00 /* Reserved */ }, + }, .hid_report_desc = (uint8_t []) {0x05, 0x01, /* Usage Page (Desktop), */ @@ -422,7 +424,7 @@ if (strcmp(override->i2c_name, i2c_name)) return NULL; - return override->i2c_hid_desc; + return override->u.i2c_hid_desc; } char *i2c_hid_get_dmi_hid_report_desc_override(uint8_t *i2c_name,