Skip to content

Commit 5b3691d

Browse files
hadessbentiss
authored andcommitted
HID: logitech-hidpp: Reconcile USB and Unifying serials
Now that USB HID++ devices can gather a serial number that matches the one that would be gathered when connected through a Unifying receiver, remove the last difference by dropping the product ID as devices usually have different product IDs when connected through USB or Unifying. For example, on the serials on a G903 wired/wireless mouse: - Unifying before patch: 4067-e8-ce-cd-45 - USB before patch: c086-e8-ce-cd-45 - Unifying and USB after patch: e8-ce-cd-45 Signed-off-by: Bastien Nocera <hadess@hadess.net> Link: https://lore.kernel.org/r/20230302130117.3975-2-hadess@hadess.net Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
1 parent 7ad1fe0 commit 5b3691d

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

drivers/hid/hid-logitech-hidpp.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -853,8 +853,7 @@ static int hidpp_unifying_init(struct hidpp_device *hidpp)
853853
if (ret)
854854
return ret;
855855

856-
snprintf(hdev->uniq, sizeof(hdev->uniq), "%04x-%4phD",
857-
hdev->product, &serial);
856+
snprintf(hdev->uniq, sizeof(hdev->uniq), "%4phD", &serial);
858857
dbg_hid("HID++ Unifying: Got serial: %s\n", hdev->uniq);
859858

860859
name = hidpp_unifying_get_name(hidpp);
@@ -989,8 +988,7 @@ static int hidpp_serial_init(struct hidpp_device *hidpp)
989988
if (ret)
990989
return ret;
991990

992-
snprintf(hdev->uniq, sizeof(hdev->uniq), "%04x-%4phD",
993-
hdev->product, &serial);
991+
snprintf(hdev->uniq, sizeof(hdev->uniq), "%4phD", &serial);
994992
dbg_hid("HID++ DeviceInformation: Got serial: %s\n", hdev->uniq);
995993

996994
return 0;

0 commit comments

Comments
 (0)