}
/* retrieve the device string as shortname */
- if (!dev->descriptor.iProduct ||
- usb_string(dev, dev->descriptor.iProduct,
- card->shortname, sizeof(card->shortname)) <= 0) {
+ if (dev->product && *dev->product) {
+ strscpy(card->shortname, dev->product);
+ } else {
/* no name available from anywhere, so use ID */
scnprintf(card->shortname, sizeof(card->shortname),
"USB Device %#04x:%#04x",
else if (quirk && quirk->vendor_name)
s = quirk->vendor_name;
*card->longname = 0;
- if (s && *s) {
- strscpy(card->longname, s, sizeof(card->longname));
- } else {
- /* retrieve the vendor and device strings as longname */
- if (dev->descriptor.iManufacturer)
- usb_string(dev, dev->descriptor.iManufacturer,
- card->longname, sizeof(card->longname));
- /* we don't really care if there isn't any vendor string */
- }
+ if (s && *s)
+ strscpy(card->longname, s);
+ else if (dev->manufacturer && *dev->manufacturer)
+ strscpy(card->longname, dev->manufacturer);
+
if (*card->longname) {
strim(card->longname);
if (*card->longname)
strscpy(ump->core.name, ump->info.name,
sizeof(ump->core.name));
/* use serial number string as unique UMP product id */
- if (!*ump->info.product_id && dev->descriptor.iSerialNumber)
- usb_string(dev, dev->descriptor.iSerialNumber,
- ump->info.product_id,
- sizeof(ump->info.product_id));
+ if (!*ump->info.product_id && dev->serial && *dev->serial)
+ strscpy(ump->info.product_id, dev->serial);
}
}