summaryrefslogtreecommitdiffstats
path: root/sound/usb
diff options
context:
space:
mode:
authorDaniel Mack <daniel@caiaq.de>2009-06-01 21:36:26 +0200
committerTakashi Iwai <tiwai@suse.de>2009-06-02 09:47:33 +0200
commit1a1df6f0434fc35c9bf6ca25f9c5115713d77291 (patch)
tree1ddce6fd6b157855add0ec2ae75dd21c9212d9be /sound/usb
parentALSA: snd_usb_caiaq: use strlcpy (diff)
downloadlinux-1a1df6f0434fc35c9bf6ca25f9c5115713d77291.tar.xz
linux-1a1df6f0434fc35c9bf6ca25f9c5115713d77291.zip
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 d06d7fcbb8e8..15052e439e30 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)
static int __devinit init_card(struct snd_usb_caiaqdev *dev)
{
- char *c;
+ char usbpath[32];
struct usb_device *usb_dev = dev->chip.dev;
struct snd_card *card = dev->chip.card;
- int err, len;
+ int err;
if (usb_set_interface(usb_dev, 0, 1) != 0) {
log("can't set alt interface.\n");
@@ -424,27 +424,14 @@ static int __devinit init_card(struct snd_usb_caiaqdev *dev)
usb_string(usb_dev, usb_dev->descriptor.iProduct,
dev->product_name, CAIAQ_USB_STR_LEN);
- usb_string(usb_dev, usb_dev->descriptor.iSerialNumber,
- dev->serial, CAIAQ_USB_STR_LEN);
-
- /* terminate serial string at first white space occurence */
- c = strchr(dev->serial, ' ');
- if (c)
- *c = '\0';
-
strlcpy(card->driver, MODNAME, sizeof(card->driver));
strlcpy(card->shortname, dev->product_name, sizeof(card->shortname));
- len = snprintf(card->longname, sizeof(card->longname),
- "%s %s (serial %s, ",
- dev->vendor_name, dev->product_name, dev->serial);
-
- if (len < sizeof(card->longname) - 2)
- len += usb_make_path(usb_dev, card->longname + len,
- sizeof(card->longname) - len);
+ usb_make_path(usb_dev, usbpath, sizeof(usbpath));
+ snprintf(card->longname, sizeof(card->longname),
+ "%s %s (%s)",
+ dev->vendor_name, dev->product_name, usbpath);
- card->longname[len++] = ')';
- card->longname[len] = '\0';
setup_card(dev);
return 0;
}
diff --git a/sound/usb/caiaq/device.h b/sound/usb/caiaq/device.h
index 4cce1ad7493d..ece73514854e 100644
--- a/sound/usb/caiaq/device.h
+++ b/sound/usb/caiaq/device.h
@@ -81,7 +81,6 @@ struct snd_usb_caiaqdev {
char vendor_name[CAIAQ_USB_STR_LEN];
char product_name[CAIAQ_USB_STR_LEN];
- char serial[CAIAQ_USB_STR_LEN];
int n_streams, n_audio_in, n_audio_out;
int streaming, first_packet, output_running;