aboutsummaryrefslogtreecommitdiffstats
path: root/sound/usb/caiaq
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2009-03-23 19:35:35 -0400
committerTakashi Iwai <tiwai@suse.de>2009-03-23 19:35:35 -0400
commitdec14f8c0eff54549e5747f8a4d1dc6c0347e2dd (patch)
treeaf1744c17c4bacad4c9524ad096d5a65f6c25c73 /sound/usb/caiaq
parent8e0ee43bc2c3e19db56a4adaa9a9b04ce885cd84 (diff)
parentb1a0aac05f044e78a589bfd7a9e2334aa640eb45 (diff)
Merge branch 'topic/snd_card_new-err' into for-linus
Diffstat (limited to 'sound/usb/caiaq')
-rw-r--r--sound/usb/caiaq/caiaq-device.c22
1 files changed, 12 insertions, 10 deletions
diff --git a/sound/usb/caiaq/caiaq-device.c b/sound/usb/caiaq/caiaq-device.c
index 41c36b055f6b..09aed2363cc9 100644
--- a/sound/usb/caiaq/caiaq-device.c
+++ b/sound/usb/caiaq/caiaq-device.c
@@ -336,9 +336,10 @@ static void __devinit setup_card(struct snd_usb_caiaqdev *dev)
336 log("Unable to set up control system (ret=%d)\n", ret); 336 log("Unable to set up control system (ret=%d)\n", ret);
337} 337}
338 338
339static struct snd_card* create_card(struct usb_device* usb_dev) 339static int create_card(struct usb_device* usb_dev, struct snd_card **cardp)
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
@@ -347,12 +348,12 @@ static struct snd_card* create_card(struct usb_device* usb_dev)
347 break; 348 break;
348 349
349 if (devnum >= SNDRV_CARDS) 350 if (devnum >= SNDRV_CARDS)
350 return NULL; 351 return -ENODEV;
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 err;
356 357
357 dev = caiaqdev(card); 358 dev = caiaqdev(card);
358 dev->chip.dev = usb_dev; 359 dev->chip.dev = usb_dev;
@@ -362,7 +363,8 @@ static struct snd_card* create_card(struct usb_device* usb_dev)
362 spin_lock_init(&dev->spinlock); 363 spin_lock_init(&dev->spinlock);
363 snd_card_set_dev(card, &usb_dev->dev); 364 snd_card_set_dev(card, &usb_dev->dev);
364 365
365 return card; 366 *cardp = card;
367 return 0;
366} 368}
367 369
368static int __devinit init_card(struct snd_usb_caiaqdev *dev) 370static int __devinit init_card(struct snd_usb_caiaqdev *dev)
@@ -441,10 +443,10 @@ static int __devinit snd_probe(struct usb_interface *intf,
441 struct snd_card *card; 443 struct snd_card *card;
442 struct usb_device *device = interface_to_usbdev(intf); 444 struct usb_device *device = interface_to_usbdev(intf);
443 445
444 card = create_card(device); 446 ret = create_card(device, &card);
445 447
446 if (!card) 448 if (ret < 0)
447 return -ENOMEM; 449 return ret;
448 450
449 usb_set_intfdata(intf, card); 451 usb_set_intfdata(intf, card);
450 ret = init_card(caiaqdev(card)); 452 ret = init_card(caiaqdev(card));