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, ...@@ -179,10 +179,9 @@ static int cougar_bind_shared_data(struct hid_device *hdev,
cougar->shared = shared; 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) { if (error) {
mutex_unlock(&cougar_udev_list_lock); mutex_unlock(&cougar_udev_list_lock);
cougar_remove_shared_data(cougar);
return error; return error;
} }
......
...@@ -160,6 +160,7 @@ static const struct hid_usage_entry hid_usage_table[] = { ...@@ -160,6 +160,7 @@ static const struct hid_usage_entry hid_usage_table[] = {
{0, 0x59, "ButtonType"}, {0, 0x59, "ButtonType"},
{0, 0x5A, "SecondaryBarrelSwitch"}, {0, 0x5A, "SecondaryBarrelSwitch"},
{0, 0x5B, "TransducerSerialNumber"}, {0, 0x5B, "TransducerSerialNumber"},
{0, 0x6e, "TransducerSerialNumber2"},
{ 15, 0, "PhysicalInterfaceDevice" }, { 15, 0, "PhysicalInterfaceDevice" },
{0, 0x00, "Undefined"}, {0, 0x00, "Undefined"},
{0, 0x01, "Physical_Interface_Device"}, {0, 0x01, "Physical_Interface_Device"},
...@@ -486,8 +487,7 @@ char *hid_resolv_usage(unsigned usage, struct seq_file *f) { ...@@ -486,8 +487,7 @@ char *hid_resolv_usage(unsigned usage, struct seq_file *f) {
if (!f) { if (!f) {
len = strlen(buf); len = strlen(buf);
snprintf(buf+len, max(0, HID_DEBUG_BUFSIZE - len), "."); len += scnprintf(buf + len, HID_DEBUG_BUFSIZE - len, ".");
len++;
} }
else { else {
seq_printf(f, "."); seq_printf(f, ".");
...@@ -498,7 +498,7 @@ char *hid_resolv_usage(unsigned usage, struct seq_file *f) { ...@@ -498,7 +498,7 @@ char *hid_resolv_usage(unsigned usage, struct seq_file *f) {
if (p->usage == (usage & 0xffff)) { if (p->usage == (usage & 0xffff)) {
if (!f) if (!f)
snprintf(buf + len, snprintf(buf + len,
max(0,HID_DEBUG_BUFSIZE - len - 1), HID_DEBUG_BUFSIZE - len,
"%s", p->description); "%s", p->description);
else else
seq_printf(f, seq_printf(f,
...@@ -509,8 +509,8 @@ char *hid_resolv_usage(unsigned usage, struct seq_file *f) { ...@@ -509,8 +509,8 @@ char *hid_resolv_usage(unsigned usage, struct seq_file *f) {
break; break;
} }
if (!f) if (!f)
snprintf(buf + len, max(0, HID_DEBUG_BUFSIZE - len - 1), snprintf(buf + len, HID_DEBUG_BUFSIZE - len, "%04x",
"%04x", usage & 0xffff); usage & 0xffff);
else else
seq_printf(f, "%04x", usage & 0xffff); seq_printf(f, "%04x", usage & 0xffff);
return buf; return buf;
......
...@@ -871,6 +871,7 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel ...@@ -871,6 +871,7 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel
break; break;
case 0x5b: /* TransducerSerialNumber */ case 0x5b: /* TransducerSerialNumber */
case 0x6e: /* TransducerSerialNumber2 */
usage->type = EV_MSC; usage->type = EV_MSC;
usage->code = MSC_SERIAL; usage->code = MSC_SERIAL;
bit = input->mscbit; 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