Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 148341
b: refs/heads/master
c: bafeee5
h: refs/heads/master
i:
  148339: 99fa4ff
v: v3
  • Loading branch information
Daniel Mack authored and Takashi Iwai committed Jun 2, 2009
1 parent f2be69e commit d2cc885
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 17db0486d73a7bc62996569cea63464daacb22a4
refs/heads/master: bafeee5b1f8d32cbf791c322b40a6fa91d8ccf7a
21 changes: 19 additions & 2 deletions trunk/sound/usb/caiaq/device.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 usbpath[32];
char *c, usbpath[32];
struct usb_device *usb_dev = dev->chip.dev;
struct snd_card *card = dev->chip.card;
int err;
int err, len;

if (usb_set_interface(usb_dev, 0, 1) != 0) {
log("can't set alt interface.\n");
Expand Down Expand Up @@ -427,6 +427,23 @@ static int __devinit init_card(struct snd_usb_caiaqdev *dev)
strlcpy(card->driver, MODNAME, sizeof(card->driver));
strlcpy(card->shortname, dev->product_name, sizeof(card->shortname));

/* if the id was not passed as module option, fill it with a shortened
* version of the product string which does not contain any
* whitespaces */

if (*card->id == '\0') {
char id[sizeof(card->id)];

memset(id, 0, sizeof(id));

for (c = card->shortname, len = 0;
*c && len < sizeof(card->id); c++)
if (*c != ' ')
id[len++] = *c;

snd_card_set_id(card, id);
}

usb_make_path(usb_dev, usbpath, sizeof(usbpath));
snprintf(card->longname, sizeof(card->longname),
"%s %s (%s)",
Expand Down

0 comments on commit d2cc885

Please sign in to comment.