aboutsummaryrefslogtreecommitdiffstats
path: root/sound/usb
diff options
context:
space:
mode:
authorDaniel Mack <daniel@caiaq.de>2009-06-01 15:36:26 -0400
committerTakashi Iwai <tiwai@suse.de>2009-06-02 03:47:33 -0400
commit1a1df6f0434fc35c9bf6ca25f9c5115713d77291 (patch)
tree1ddce6fd6b157855add0ec2ae75dd21c9212d9be /sound/usb
parentd3873a1be9f2d497e9ff013e4a83a2a4d9f1d22d (diff)
ALSA: snd_usb_caiaq: give better longname
The serial number is of no interest in the longname, remove it. This gives space for the usb path information which is more informative. Signed-off-by: Daniel Mack <daniel@caiaq.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/usb')
-rw-r--r--sound/usb/caiaq/device.c25
-rw-r--r--sound/usb/caiaq/device.h1
2 files changed, 6 insertions, 20 deletions
diff --git a/sound/usb/caiaq/device.c b/sound/usb/caiaq/device.c
index d06d7fcbb8e..15052e439e3 100644
--- a/sound/usb/caiaq/device.c
+++ b/sound/usb/caiaq/device.c
@@ -382,10 +382,10 @@ static int create_card(struct usb_device* usb_dev, struct snd_card **cardp)
382 382
383static int __devinit init_card(struct snd_usb_caiaqdev *dev) 383static int __devinit init_card(struct snd_usb_caiaqdev *dev)
384{ 384{
385 char *c; 385 char usbpath[32];
386 struct usb_device *usb_dev = dev->chip.dev; 386 struct usb_device *usb_dev = dev->chip.dev;
387 struct snd_card *card = dev->chip.card; 387 struct snd_card *card = dev->chip.card;
388 int err, len; 388 int err;
389 389
390 if (usb_set_interface(usb_dev, 0, 1) != 0) { 390 if (usb_set_interface(usb_dev, 0, 1) != 0) {
391 log("can't set alt interface.\n"); 391 log("can't set alt interface.\n");
@@ -424,27 +424,14 @@ static int __devinit init_card(struct snd_usb_caiaqdev *dev)
424 usb_string(usb_dev, usb_dev->descriptor.iProduct, 424 usb_string(usb_dev, usb_dev->descriptor.iProduct,
425 dev->product_name, CAIAQ_USB_STR_LEN); 425 dev->product_name, CAIAQ_USB_STR_LEN);
426 426
427 usb_string(usb_dev, usb_dev->descriptor.iSerialNumber,
428 dev->serial, CAIAQ_USB_STR_LEN);
429
430 /* terminate serial string at first white space occurence */
431 c = strchr(dev->serial, ' ');
432 if (c)
433 *c = '\0';
434
435 strlcpy(card->driver, MODNAME, sizeof(card->driver)); 427 strlcpy(card->driver, MODNAME, sizeof(card->driver));
436 strlcpy(card->shortname, dev->product_name, sizeof(card->shortname)); 428 strlcpy(card->shortname, dev->product_name, sizeof(card->shortname));
437 429
438 len = snprintf(card->longname, sizeof(card->longname), 430 usb_make_path(usb_dev, usbpath, sizeof(usbpath));
439 "%s %s (serial %s, ", 431 snprintf(card->longname, sizeof(card->longname),
440 dev->vendor_name, dev->product_name, dev->serial); 432 "%s %s (%s)",
441 433 dev->vendor_name, dev->product_name, usbpath);
442 if (len < sizeof(card->longname) - 2)
443 len += usb_make_path(usb_dev, card->longname + len,
444 sizeof(card->longname) - len);
445 434
446 card->longname[len++] = ')';
447 card->longname[len] = '\0';
448 setup_card(dev); 435 setup_card(dev);
449 return 0; 436 return 0;
450} 437}
diff --git a/sound/usb/caiaq/device.h b/sound/usb/caiaq/device.h
index 4cce1ad7493..ece73514854 100644
--- a/sound/usb/caiaq/device.h
+++ b/sound/usb/caiaq/device.h
@@ -81,7 +81,6 @@ struct snd_usb_caiaqdev {
81 81
82 char vendor_name[CAIAQ_USB_STR_LEN]; 82 char vendor_name[CAIAQ_USB_STR_LEN];
83 char product_name[CAIAQ_USB_STR_LEN]; 83 char product_name[CAIAQ_USB_STR_LEN];
84 char serial[CAIAQ_USB_STR_LEN];
85 84
86 int n_streams, n_audio_in, n_audio_out; 85 int n_streams, n_audio_in, n_audio_out;
87 int streaming, first_packet, output_running; 86 int streaming, first_packet, output_running;