vxpocket.c (c1f3ee120bb61045b1c0a3ead620d1d65af47130) | vxpocket.c (bd7dd77c2a05c530684eea2e3af16449ae9c5d52) |
---|---|
1/* 2 * Driver for Digigram VXpocket V2/440 soundcards 3 * 4 * Copyright (c) 2002 by Takashi Iwai <tiwai@suse.de> 5 * 6 * This program is free software; you can redistribute it and/or modify 7 * it under the terms of the GNU General Public License as published by 8 * the Free Software Foundation; either version 2 of the License, or --- 278 unchanged lines hidden (view full) --- 287 288 289/* 290 */ 291static int vxpocket_probe(struct pcmcia_device *p_dev) 292{ 293 struct snd_card *card; 294 struct snd_vxpocket *vxp; | 1/* 2 * Driver for Digigram VXpocket V2/440 soundcards 3 * 4 * Copyright (c) 2002 by Takashi Iwai <tiwai@suse.de> 5 * 6 * This program is free software; you can redistribute it and/or modify 7 * it under the terms of the GNU General Public License as published by 8 * the Free Software Foundation; either version 2 of the License, or --- 278 unchanged lines hidden (view full) --- 287 288 289/* 290 */ 291static int vxpocket_probe(struct pcmcia_device *p_dev) 292{ 293 struct snd_card *card; 294 struct snd_vxpocket *vxp; |
295 int i; | 295 int i, err; |
296 297 /* find an empty slot from the card list */ 298 for (i = 0; i < SNDRV_CARDS; i++) { 299 if (!(card_alloc & (1 << i))) 300 break; 301 } 302 if (i >= SNDRV_CARDS) { 303 snd_printk(KERN_ERR "vxpocket: too many cards found\n"); 304 return -EINVAL; 305 } 306 if (! enable[i]) 307 return -ENODEV; /* disabled explicitly */ 308 309 /* ok, create a card instance */ | 296 297 /* find an empty slot from the card list */ 298 for (i = 0; i < SNDRV_CARDS; i++) { 299 if (!(card_alloc & (1 << i))) 300 break; 301 } 302 if (i >= SNDRV_CARDS) { 303 snd_printk(KERN_ERR "vxpocket: too many cards found\n"); 304 return -EINVAL; 305 } 306 if (! enable[i]) 307 return -ENODEV; /* disabled explicitly */ 308 309 /* ok, create a card instance */ |
310 card = snd_card_new(index[i], id[i], THIS_MODULE, 0); 311 if (card == NULL) { | 310 err = snd_card_create(index[i], id[i], THIS_MODULE, 0, &card); 311 if (err < 0) { |
312 snd_printk(KERN_ERR "vxpocket: cannot create a card instance\n"); | 312 snd_printk(KERN_ERR "vxpocket: cannot create a card instance\n"); |
313 return -ENOMEM; | 313 return err; |
314 } 315 316 vxp = snd_vxpocket_new(card, ibl[i], p_dev); 317 if (! vxp) { 318 snd_card_free(card); 319 return -ENODEV; 320 } 321 card->private_data = vxp; --- 63 unchanged lines hidden --- | 314 } 315 316 vxp = snd_vxpocket_new(card, ibl[i], p_dev); 317 if (! vxp) { 318 snd_card_free(card); 319 return -ENODEV; 320 } 321 card->private_data = vxp; --- 63 unchanged lines hidden --- |