diff options
Diffstat (limited to 'sound/usb/caiaq/caiaq-device.c')
-rw-r--r-- | sound/usb/caiaq/caiaq-device.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/sound/usb/caiaq/caiaq-device.c b/sound/usb/caiaq/caiaq-device.c index 63a2c1d5779b..55a9075cb097 100644 --- a/sound/usb/caiaq/caiaq-device.c +++ b/sound/usb/caiaq/caiaq-device.c | |||
@@ -336,7 +336,7 @@ 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 | ||
339 | static struct snd_card* create_card(struct usb_device* usb_dev) | 339 | static int create_card(struct usb_device* usb_dev, struct snd_card **cardp) |
340 | { | 340 | { |
341 | int devnum; | 341 | int devnum; |
342 | int err; | 342 | int err; |
@@ -348,12 +348,12 @@ static struct snd_card* create_card(struct usb_device* usb_dev) | |||
348 | break; | 348 | break; |
349 | 349 | ||
350 | if (devnum >= SNDRV_CARDS) | 350 | if (devnum >= SNDRV_CARDS) |
351 | return NULL; | 351 | return -ENODEV; |
352 | 352 | ||
353 | err = snd_card_create(index[devnum], id[devnum], THIS_MODULE, | 353 | err = snd_card_create(index[devnum], id[devnum], THIS_MODULE, |
354 | sizeof(struct snd_usb_caiaqdev), &card); | 354 | sizeof(struct snd_usb_caiaqdev), &card); |
355 | if (err < 0) | 355 | if (err < 0) |
356 | return NULL; | 356 | return err; |
357 | 357 | ||
358 | dev = caiaqdev(card); | 358 | dev = caiaqdev(card); |
359 | dev->chip.dev = usb_dev; | 359 | dev->chip.dev = usb_dev; |
@@ -363,7 +363,8 @@ static struct snd_card* create_card(struct usb_device* usb_dev) | |||
363 | spin_lock_init(&dev->spinlock); | 363 | spin_lock_init(&dev->spinlock); |
364 | snd_card_set_dev(card, &usb_dev->dev); | 364 | snd_card_set_dev(card, &usb_dev->dev); |
365 | 365 | ||
366 | return card; | 366 | *cardp = card; |
367 | return 0; | ||
367 | } | 368 | } |
368 | 369 | ||
369 | static int __devinit init_card(struct snd_usb_caiaqdev *dev) | 370 | static int __devinit init_card(struct snd_usb_caiaqdev *dev) |
@@ -442,10 +443,10 @@ static int __devinit snd_probe(struct usb_interface *intf, | |||
442 | struct snd_card *card; | 443 | struct snd_card *card; |
443 | struct usb_device *device = interface_to_usbdev(intf); | 444 | struct usb_device *device = interface_to_usbdev(intf); |
444 | 445 | ||
445 | card = create_card(device); | 446 | ret = create_card(device, &card); |
446 | 447 | ||
447 | if (!card) | 448 | if (ret < 0) |
448 | return -ENOMEM; | 449 | return ret; |
449 | 450 | ||
450 | usb_set_intfdata(intf, card); | 451 | usb_set_intfdata(intf, card); |
451 | ret = init_card(caiaqdev(card)); | 452 | ret = init_card(caiaqdev(card)); |