aboutsummaryrefslogtreecommitdiffstats
path: root/sound/usb
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@alsa3.local>2008-12-28 10:45:02 -0500
committerTakashi Iwai <tiwai@suse.de>2009-01-12 09:21:19 -0500
commitbd7dd77c2a05c530684eea2e3af16449ae9c5d52 (patch)
treef26e8b6c83ed58d3c2d47f9df6373812db80a885 /sound/usb
parente58de7baf7de11f01a675cbbf6ecc8a2758b9ca5 (diff)
ALSA: Convert to snd_card_create() in other sound/*
Convert from snd_card_new() to the new snd_card_create() function in other sound subdirectories. Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/usb')
-rw-r--r--sound/usb/caiaq/caiaq-device.c7
-rw-r--r--sound/usb/usbaudio.c6
-rw-r--r--sound/usb/usx2y/us122l.c8
-rw-r--r--sound/usb/usx2y/usbusx2y.c7
4 files changed, 17 insertions, 11 deletions
diff --git a/sound/usb/caiaq/caiaq-device.c b/sound/usb/caiaq/caiaq-device.c
index a62500e387a6..63a2c1d5779b 100644
--- a/sound/usb/caiaq/caiaq-device.c
+++ b/sound/usb/caiaq/caiaq-device.c
@@ -339,6 +339,7 @@ static void __devinit setup_card(struct snd_usb_caiaqdev *dev)
339static struct snd_card* create_card(struct usb_device* usb_dev) 339static struct snd_card* create_card(struct usb_device* usb_dev)
340{ 340{
341 int devnum; 341 int devnum;
342 int err;
342 struct snd_card *card; 343 struct snd_card *card;
343 struct snd_usb_caiaqdev *dev; 344 struct snd_usb_caiaqdev *dev;
344 345
@@ -349,9 +350,9 @@ static struct snd_card* create_card(struct usb_device* usb_dev)
349 if (devnum >= SNDRV_CARDS) 350 if (devnum >= SNDRV_CARDS)
350 return NULL; 351 return NULL;
351 352
352 card = snd_card_new(index[devnum], id[devnum], THIS_MODULE, 353 err = snd_card_create(index[devnum], id[devnum], THIS_MODULE,
353 sizeof(struct snd_usb_caiaqdev)); 354 sizeof(struct snd_usb_caiaqdev), &card);
354 if (!card) 355 if (err < 0)
355 return NULL; 356 return NULL;
356 357
357 dev = caiaqdev(card); 358 dev = caiaqdev(card);
diff --git a/sound/usb/usbaudio.c b/sound/usb/usbaudio.c
index c709b9563226..eec32e1a3020 100644
--- a/sound/usb/usbaudio.c
+++ b/sound/usb/usbaudio.c
@@ -3463,10 +3463,10 @@ static int snd_usb_audio_create(struct usb_device *dev, int idx,
3463 return -ENXIO; 3463 return -ENXIO;
3464 } 3464 }
3465 3465
3466 card = snd_card_new(index[idx], id[idx], THIS_MODULE, 0); 3466 err = snd_card_create(index[idx], id[idx], THIS_MODULE, 0, &card);
3467 if (card == NULL) { 3467 if (err < 0) {
3468 snd_printk(KERN_ERR "cannot create card instance %d\n", idx); 3468 snd_printk(KERN_ERR "cannot create card instance %d\n", idx);
3469 return -ENOMEM; 3469 return err;
3470 } 3470 }
3471 3471
3472 chip = kzalloc(sizeof(*chip), GFP_KERNEL); 3472 chip = kzalloc(sizeof(*chip), GFP_KERNEL);
diff --git a/sound/usb/usx2y/us122l.c b/sound/usb/usx2y/us122l.c
index 73e59f4403a4..b21bb475c0ff 100644
--- a/sound/usb/usx2y/us122l.c
+++ b/sound/usb/usx2y/us122l.c
@@ -482,14 +482,16 @@ static struct snd_card *usx2y_create_card(struct usb_device *device)
482{ 482{
483 int dev; 483 int dev;
484 struct snd_card *card; 484 struct snd_card *card;
485 int err;
486
485 for (dev = 0; dev < SNDRV_CARDS; ++dev) 487 for (dev = 0; dev < SNDRV_CARDS; ++dev)
486 if (enable[dev] && !snd_us122l_card_used[dev]) 488 if (enable[dev] && !snd_us122l_card_used[dev])
487 break; 489 break;
488 if (dev >= SNDRV_CARDS) 490 if (dev >= SNDRV_CARDS)
489 return NULL; 491 return NULL;
490 card = snd_card_new(index[dev], id[dev], THIS_MODULE, 492 err = snd_card_create(index[dev], id[dev], THIS_MODULE,
491 sizeof(struct us122l)); 493 sizeof(struct us122l), &card);
492 if (!card) 494 if (err < 0)
493 return NULL; 495 return NULL;
494 snd_us122l_card_used[US122L(card)->chip.index = dev] = 1; 496 snd_us122l_card_used[US122L(card)->chip.index = dev] = 1;
495 497
diff --git a/sound/usb/usx2y/usbusx2y.c b/sound/usb/usx2y/usbusx2y.c
index 11639bd72a51..b848a1806385 100644
--- a/sound/usb/usx2y/usbusx2y.c
+++ b/sound/usb/usx2y/usbusx2y.c
@@ -337,13 +337,16 @@ static struct snd_card *usX2Y_create_card(struct usb_device *device)
337{ 337{
338 int dev; 338 int dev;
339 struct snd_card * card; 339 struct snd_card * card;
340 int err;
341
340 for (dev = 0; dev < SNDRV_CARDS; ++dev) 342 for (dev = 0; dev < SNDRV_CARDS; ++dev)
341 if (enable[dev] && !snd_usX2Y_card_used[dev]) 343 if (enable[dev] && !snd_usX2Y_card_used[dev])
342 break; 344 break;
343 if (dev >= SNDRV_CARDS) 345 if (dev >= SNDRV_CARDS)
344 return NULL; 346 return NULL;
345 card = snd_card_new(index[dev], id[dev], THIS_MODULE, sizeof(struct usX2Ydev)); 347 err = snd_card_create(index[dev], id[dev], THIS_MODULE,
346 if (!card) 348 sizeof(struct usX2Ydev), &card);
349 if (err < 0)
347 return NULL; 350 return NULL;
348 snd_usX2Y_card_used[usX2Y(card)->chip.index = dev] = 1; 351 snd_usX2Y_card_used[usX2Y(card)->chip.index = dev] = 1;
349 card->private_free = snd_usX2Y_card_private_free; 352 card->private_free = snd_usX2Y_card_private_free;