diff --git a/drivers/hid/usbhid/hid-core.c b/drivers/hid/usbhid/hid-core.c index fb588ac24acc58..f129e61f8ece89 100644 --- a/drivers/hid/usbhid/hid-core.c +++ b/drivers/hid/usbhid/hid-core.c @@ -1388,8 +1388,11 @@ static int usbhid_probe(struct usb_interface *intf, const struct usb_device_id * else if (intf->cur_altsetting->desc.bInterfaceProtocol == 0) hid->type = HID_TYPE_USBNONE; - if (dev->manufacturer) - strscpy(hid->name, dev->manufacturer, sizeof(hid->name)); + snprintf(hid->name, sizeof(hid->name), "usb-%s ", dev_name(&dev->dev)); + + if (dev->manufacturer) { + strlcat(hid->name, dev->manufacturer, sizeof(hid->name)); + } if (dev->product) { if (dev->manufacturer) @@ -1397,8 +1400,9 @@ static int usbhid_probe(struct usb_interface *intf, const struct usb_device_id * strlcat(hid->name, dev->product, sizeof(hid->name)); } - if (!strlen(hid->name)) - snprintf(hid->name, sizeof(hid->name), "HID %04x:%04x", + if (strlen(hid->name) == strlen(dev_name(&dev->dev))) + snprintf(hid->name, sizeof(hid->name), "usb-%s HID %04x:%04x", + dev_name(&dev->dev), le16_to_cpu(dev->descriptor.idVendor), le16_to_cpu(dev->descriptor.idProduct));