Commit b026277a authored by Jiri Kosina's avatar Jiri Kosina

Merge branch 'for-5.16/core' into for-linus

- update to handle TransducerSerialNumber2 which has been recently
  added to the specification (Felipe Balbi)
parents 820e9906 8e3cd922
......@@ -179,10 +179,9 @@ static int cougar_bind_shared_data(struct hid_device *hdev,
cougar->shared = shared;
error = devm_add_action(&hdev->dev, cougar_remove_shared_data, cougar);
error = devm_add_action_or_reset(&hdev->dev, cougar_remove_shared_data, cougar);
if (error) {
mutex_unlock(&cougar_udev_list_lock);
cougar_remove_shared_data(cougar);
return error;
}
......
......@@ -160,6 +160,7 @@ static const struct hid_usage_entry hid_usage_table[] = {
{0, 0x59, "ButtonType"},
{0, 0x5A, "SecondaryBarrelSwitch"},
{0, 0x5B, "TransducerSerialNumber"},
{0, 0x6e, "TransducerSerialNumber2"},
{ 15, 0, "PhysicalInterfaceDevice" },
{0, 0x00, "Undefined"},
{0, 0x01, "Physical_Interface_Device"},
......@@ -486,8 +487,7 @@ char *hid_resolv_usage(unsigned usage, struct seq_file *f) {
if (!f) {
len = strlen(buf);
snprintf(buf+len, max(0, HID_DEBUG_BUFSIZE - len), ".");
len++;
len += scnprintf(buf + len, HID_DEBUG_BUFSIZE - len, ".");
}
else {
seq_printf(f, ".");
......@@ -498,7 +498,7 @@ char *hid_resolv_usage(unsigned usage, struct seq_file *f) {
if (p->usage == (usage & 0xffff)) {
if (!f)
snprintf(buf + len,
max(0,HID_DEBUG_BUFSIZE - len - 1),
HID_DEBUG_BUFSIZE - len,
"%s", p->description);
else
seq_printf(f,
......@@ -509,8 +509,8 @@ char *hid_resolv_usage(unsigned usage, struct seq_file *f) {
break;
}
if (!f)
snprintf(buf + len, max(0, HID_DEBUG_BUFSIZE - len - 1),
"%04x", usage & 0xffff);
snprintf(buf + len, HID_DEBUG_BUFSIZE - len, "%04x",
usage & 0xffff);
else
seq_printf(f, "%04x", usage & 0xffff);
return buf;
......
......@@ -871,6 +871,7 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel
break;
case 0x5b: /* TransducerSerialNumber */
case 0x6e: /* TransducerSerialNumber2 */
usage->type = EV_MSC;
usage->code = MSC_SERIAL;
bit = input->mscbit;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment