diff options
author | Takashi Iwai <tiwai@suse.de> | 2009-02-16 17:03:57 -0500 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2009-02-16 17:03:57 -0500 |
commit | 96cf45cf559be375de29dd45afc50fa8946fb2aa (patch) | |
tree | 06242d4256aadc01aee67dfafbb94541e7a17738 /sound/isa | |
parent | 4c9f1d3ed7e5f910b66dc4d1456cfac17e58cf0e (diff) | |
parent | b1a0aac05f044e78a589bfd7a9e2334aa640eb45 (diff) |
Merge branch 'topic/snd_card_new-err' into topic/cs423x-merge
Diffstat (limited to 'sound/isa')
-rw-r--r-- | sound/isa/ad1816a/ad1816a.c | 7 | ||||
-rw-r--r-- | sound/isa/ad1848/ad1848.c | 6 | ||||
-rw-r--r-- | sound/isa/adlib.c | 6 | ||||
-rw-r--r-- | sound/isa/als100.c | 7 | ||||
-rw-r--r-- | sound/isa/azt2320.c | 7 | ||||
-rw-r--r-- | sound/isa/cmi8330.c | 26 | ||||
-rw-r--r-- | sound/isa/cs423x/cs4231.c | 6 | ||||
-rw-r--r-- | sound/isa/cs423x/cs4236.c | 32 | ||||
-rw-r--r-- | sound/isa/dt019x.c | 7 | ||||
-rw-r--r-- | sound/isa/es1688/es1688.c | 6 | ||||
-rw-r--r-- | sound/isa/es18xx.c | 24 | ||||
-rw-r--r-- | sound/isa/gus/gusclassic.c | 6 | ||||
-rw-r--r-- | sound/isa/gus/gusextreme.c | 6 | ||||
-rw-r--r-- | sound/isa/gus/gusmax.c | 8 | ||||
-rw-r--r-- | sound/isa/gus/interwave.c | 26 | ||||
-rw-r--r-- | sound/isa/opl3sa2.c | 31 | ||||
-rw-r--r-- | sound/isa/opti9xx/miro.c | 7 | ||||
-rw-r--r-- | sound/isa/opti9xx/opti92x-ad1848.c | 25 | ||||
-rw-r--r-- | sound/isa/sb/es968.c | 7 | ||||
-rw-r--r-- | sound/isa/sb/sb16.c | 28 | ||||
-rw-r--r-- | sound/isa/sb/sb8.c | 8 | ||||
-rw-r--r-- | sound/isa/sc6000.c | 6 | ||||
-rw-r--r-- | sound/isa/sgalaxy.c | 6 | ||||
-rw-r--r-- | sound/isa/sscape.c | 16 | ||||
-rw-r--r-- | sound/isa/wavefront/wavefront.c | 26 |
25 files changed, 182 insertions, 158 deletions
diff --git a/sound/isa/ad1816a/ad1816a.c b/sound/isa/ad1816a/ad1816a.c index 15f60107a11e..bbcbf92a8ebe 100644 --- a/sound/isa/ad1816a/ad1816a.c +++ b/sound/isa/ad1816a/ad1816a.c | |||
@@ -158,9 +158,10 @@ static int __devinit snd_card_ad1816a_probe(int dev, struct pnp_card_link *pcard | |||
158 | struct snd_opl3 *opl3; | 158 | struct snd_opl3 *opl3; |
159 | struct snd_timer *timer; | 159 | struct snd_timer *timer; |
160 | 160 | ||
161 | if ((card = snd_card_new(index[dev], id[dev], THIS_MODULE, | 161 | error = snd_card_create(index[dev], id[dev], THIS_MODULE, |
162 | sizeof(struct snd_card_ad1816a))) == NULL) | 162 | sizeof(struct snd_card_ad1816a), &card); |
163 | return -ENOMEM; | 163 | if (error < 0) |
164 | return error; | ||
164 | acard = (struct snd_card_ad1816a *)card->private_data; | 165 | acard = (struct snd_card_ad1816a *)card->private_data; |
165 | 166 | ||
166 | if ((error = snd_card_ad1816a_pnp(dev, acard, pcard, pid))) { | 167 | if ((error = snd_card_ad1816a_pnp(dev, acard, pcard, pid))) { |
diff --git a/sound/isa/ad1848/ad1848.c b/sound/isa/ad1848/ad1848.c index 223a6c038819..4beeb6f98e0e 100644 --- a/sound/isa/ad1848/ad1848.c +++ b/sound/isa/ad1848/ad1848.c | |||
@@ -91,9 +91,9 @@ static int __devinit snd_ad1848_probe(struct device *dev, unsigned int n) | |||
91 | struct snd_pcm *pcm; | 91 | struct snd_pcm *pcm; |
92 | int error; | 92 | int error; |
93 | 93 | ||
94 | card = snd_card_new(index[n], id[n], THIS_MODULE, 0); | 94 | error = snd_card_create(index[n], id[n], THIS_MODULE, 0, &card); |
95 | if (!card) | 95 | if (error < 0) |
96 | return -EINVAL; | 96 | return error; |
97 | 97 | ||
98 | error = snd_wss_create(card, port[n], -1, irq[n], dma1[n], -1, | 98 | error = snd_wss_create(card, port[n], -1, irq[n], dma1[n], -1, |
99 | thinkpad[n] ? WSS_HW_THINKPAD : WSS_HW_DETECT, | 99 | thinkpad[n] ? WSS_HW_THINKPAD : WSS_HW_DETECT, |
diff --git a/sound/isa/adlib.c b/sound/isa/adlib.c index 374b7177e111..7465ae036e0b 100644 --- a/sound/isa/adlib.c +++ b/sound/isa/adlib.c | |||
@@ -53,10 +53,10 @@ static int __devinit snd_adlib_probe(struct device *dev, unsigned int n) | |||
53 | struct snd_opl3 *opl3; | 53 | struct snd_opl3 *opl3; |
54 | int error; | 54 | int error; |
55 | 55 | ||
56 | card = snd_card_new(index[n], id[n], THIS_MODULE, 0); | 56 | error = snd_card_create(index[n], id[n], THIS_MODULE, 0, &card); |
57 | if (!card) { | 57 | if (error < 0) { |
58 | dev_err(dev, "could not create card\n"); | 58 | dev_err(dev, "could not create card\n"); |
59 | return -EINVAL; | 59 | return error; |
60 | } | 60 | } |
61 | 61 | ||
62 | card->private_data = request_region(port[n], 4, CRD_NAME); | 62 | card->private_data = request_region(port[n], 4, CRD_NAME); |
diff --git a/sound/isa/als100.c b/sound/isa/als100.c index f1ce30f379c9..5fd52e4d7079 100644 --- a/sound/isa/als100.c +++ b/sound/isa/als100.c | |||
@@ -163,9 +163,10 @@ static int __devinit snd_card_als100_probe(int dev, | |||
163 | struct snd_card_als100 *acard; | 163 | struct snd_card_als100 *acard; |
164 | struct snd_opl3 *opl3; | 164 | struct snd_opl3 *opl3; |
165 | 165 | ||
166 | if ((card = snd_card_new(index[dev], id[dev], THIS_MODULE, | 166 | error = snd_card_create(index[dev], id[dev], THIS_MODULE, |
167 | sizeof(struct snd_card_als100))) == NULL) | 167 | sizeof(struct snd_card_als100), &card); |
168 | return -ENOMEM; | 168 | if (error < 0) |
169 | return error; | ||
169 | acard = card->private_data; | 170 | acard = card->private_data; |
170 | 171 | ||
171 | if ((error = snd_card_als100_pnp(dev, acard, pcard, pid))) { | 172 | if ((error = snd_card_als100_pnp(dev, acard, pcard, pid))) { |
diff --git a/sound/isa/azt2320.c b/sound/isa/azt2320.c index 3e74d1a3928e..f7aa637b0d18 100644 --- a/sound/isa/azt2320.c +++ b/sound/isa/azt2320.c | |||
@@ -184,9 +184,10 @@ static int __devinit snd_card_azt2320_probe(int dev, | |||
184 | struct snd_wss *chip; | 184 | struct snd_wss *chip; |
185 | struct snd_opl3 *opl3; | 185 | struct snd_opl3 *opl3; |
186 | 186 | ||
187 | if ((card = snd_card_new(index[dev], id[dev], THIS_MODULE, | 187 | error = snd_card_create(index[dev], id[dev], THIS_MODULE, |
188 | sizeof(struct snd_card_azt2320))) == NULL) | 188 | sizeof(struct snd_card_azt2320), &card); |
189 | return -ENOMEM; | 189 | if (error < 0) |
190 | return error; | ||
190 | acard = (struct snd_card_azt2320 *)card->private_data; | 191 | acard = (struct snd_card_azt2320 *)card->private_data; |
191 | 192 | ||
192 | if ((error = snd_card_azt2320_pnp(dev, acard, pcard, pid))) { | 193 | if ((error = snd_card_azt2320_pnp(dev, acard, pcard, pid))) { |
diff --git a/sound/isa/cmi8330.c b/sound/isa/cmi8330.c index 9ca8122f7ba2..de83608719ea 100644 --- a/sound/isa/cmi8330.c +++ b/sound/isa/cmi8330.c | |||
@@ -497,20 +497,22 @@ static int snd_cmi8330_resume(struct snd_card *card) | |||
497 | 497 | ||
498 | #define PFX "cmi8330: " | 498 | #define PFX "cmi8330: " |
499 | 499 | ||
500 | static struct snd_card *snd_cmi8330_card_new(int dev) | 500 | static int snd_cmi8330_card_new(int dev, struct snd_card **cardp) |
501 | { | 501 | { |
502 | struct snd_card *card; | 502 | struct snd_card *card; |
503 | struct snd_cmi8330 *acard; | 503 | struct snd_cmi8330 *acard; |
504 | int err; | ||
504 | 505 | ||
505 | card = snd_card_new(index[dev], id[dev], THIS_MODULE, | 506 | err = snd_card_create(index[dev], id[dev], THIS_MODULE, |
506 | sizeof(struct snd_cmi8330)); | 507 | sizeof(struct snd_cmi8330), &card); |
507 | if (card == NULL) { | 508 | if (err < 0) { |
508 | snd_printk(KERN_ERR PFX "could not get a new card\n"); | 509 | snd_printk(KERN_ERR PFX "could not get a new card\n"); |
509 | return NULL; | 510 | return err; |
510 | } | 511 | } |
511 | acard = card->private_data; | 512 | acard = card->private_data; |
512 | acard->card = card; | 513 | acard->card = card; |
513 | return card; | 514 | *cardp = card; |
515 | return 0; | ||
514 | } | 516 | } |
515 | 517 | ||
516 | static int __devinit snd_cmi8330_probe(struct snd_card *card, int dev) | 518 | static int __devinit snd_cmi8330_probe(struct snd_card *card, int dev) |
@@ -616,9 +618,9 @@ static int __devinit snd_cmi8330_isa_probe(struct device *pdev, | |||
616 | struct snd_card *card; | 618 | struct snd_card *card; |
617 | int err; | 619 | int err; |
618 | 620 | ||
619 | card = snd_cmi8330_card_new(dev); | 621 | err = snd_cmi8330_card_new(dev, &card); |
620 | if (! card) | 622 | if (err < 0) |
621 | return -ENOMEM; | 623 | return err; |
622 | snd_card_set_dev(card, pdev); | 624 | snd_card_set_dev(card, pdev); |
623 | if ((err = snd_cmi8330_probe(card, dev)) < 0) { | 625 | if ((err = snd_cmi8330_probe(card, dev)) < 0) { |
624 | snd_card_free(card); | 626 | snd_card_free(card); |
@@ -680,9 +682,9 @@ static int __devinit snd_cmi8330_pnp_detect(struct pnp_card_link *pcard, | |||
680 | if (dev >= SNDRV_CARDS) | 682 | if (dev >= SNDRV_CARDS) |
681 | return -ENODEV; | 683 | return -ENODEV; |
682 | 684 | ||
683 | card = snd_cmi8330_card_new(dev); | 685 | res = snd_cmi8330_card_new(dev, &card); |
684 | if (! card) | 686 | if (res < 0) |
685 | return -ENOMEM; | 687 | return res; |
686 | if ((res = snd_cmi8330_pnp(dev, card->private_data, pcard, pid)) < 0) { | 688 | if ((res = snd_cmi8330_pnp(dev, card->private_data, pcard, pid)) < 0) { |
687 | snd_printk(KERN_ERR PFX "PnP detection failed\n"); | 689 | snd_printk(KERN_ERR PFX "PnP detection failed\n"); |
688 | snd_card_free(card); | 690 | snd_card_free(card); |
diff --git a/sound/isa/cs423x/cs4231.c b/sound/isa/cs423x/cs4231.c index f019d449e2d6..cb9153e75b82 100644 --- a/sound/isa/cs423x/cs4231.c +++ b/sound/isa/cs423x/cs4231.c | |||
@@ -95,9 +95,9 @@ static int __devinit snd_cs4231_probe(struct device *dev, unsigned int n) | |||
95 | struct snd_pcm *pcm; | 95 | struct snd_pcm *pcm; |
96 | int error; | 96 | int error; |
97 | 97 | ||
98 | card = snd_card_new(index[n], id[n], THIS_MODULE, 0); | 98 | error = snd_card_create(index[n], id[n], THIS_MODULE, 0, &card); |
99 | if (!card) | 99 | if (error < 0) |
100 | return -EINVAL; | 100 | return error; |
101 | 101 | ||
102 | error = snd_wss_create(card, port[n], -1, irq[n], dma1[n], dma2[n], | 102 | error = snd_wss_create(card, port[n], -1, irq[n], dma1[n], dma2[n], |
103 | WSS_HW_DETECT, 0, &chip); | 103 | WSS_HW_DETECT, 0, &chip); |
diff --git a/sound/isa/cs423x/cs4236.c b/sound/isa/cs423x/cs4236.c index 019c9401663e..f7845986f467 100644 --- a/sound/isa/cs423x/cs4236.c +++ b/sound/isa/cs423x/cs4236.c | |||
@@ -382,16 +382,18 @@ static void snd_card_cs4236_free(struct snd_card *card) | |||
382 | release_and_free_resource(acard->res_sb_port); | 382 | release_and_free_resource(acard->res_sb_port); |
383 | } | 383 | } |
384 | 384 | ||
385 | static struct snd_card *snd_cs423x_card_new(int dev) | 385 | static int snd_cs423x_card_new(int dev, struct snd_card **cardp) |
386 | { | 386 | { |
387 | struct snd_card *card; | 387 | struct snd_card *card; |
388 | int err; | ||
388 | 389 | ||
389 | card = snd_card_new(index[dev], id[dev], THIS_MODULE, | 390 | err = snd_card_create(index[dev], id[dev], THIS_MODULE, |
390 | sizeof(struct snd_card_cs4236)); | 391 | sizeof(struct snd_card_cs4236), &card); |
391 | if (card == NULL) | 392 | if (err < 0) |
392 | return NULL; | 393 | return err; |
393 | card->private_free = snd_card_cs4236_free; | 394 | card->private_free = snd_card_cs4236_free; |
394 | return card; | 395 | *cardp = card; |
396 | return 0; | ||
395 | } | 397 | } |
396 | 398 | ||
397 | static int __devinit snd_cs423x_probe(struct snd_card *card, int dev) | 399 | static int __devinit snd_cs423x_probe(struct snd_card *card, int dev) |
@@ -512,9 +514,9 @@ static int __devinit snd_cs423x_isa_probe(struct device *pdev, | |||
512 | struct snd_card *card; | 514 | struct snd_card *card; |
513 | int err; | 515 | int err; |
514 | 516 | ||
515 | card = snd_cs423x_card_new(dev); | 517 | err = snd_cs423x_card_new(dev, &card); |
516 | if (! card) | 518 | if (err < 0) |
517 | return -ENOMEM; | 519 | return err; |
518 | snd_card_set_dev(card, pdev); | 520 | snd_card_set_dev(card, pdev); |
519 | if ((err = snd_cs423x_probe(card, dev)) < 0) { | 521 | if ((err = snd_cs423x_probe(card, dev)) < 0) { |
520 | snd_card_free(card); | 522 | snd_card_free(card); |
@@ -594,9 +596,9 @@ static int __devinit snd_cs4232_pnpbios_detect(struct pnp_dev *pdev, | |||
594 | if (dev >= SNDRV_CARDS) | 596 | if (dev >= SNDRV_CARDS) |
595 | return -ENODEV; | 597 | return -ENODEV; |
596 | 598 | ||
597 | card = snd_cs423x_card_new(dev); | 599 | err = snd_cs423x_card_new(dev, &card); |
598 | if (! card) | 600 | if (err < 0) |
599 | return -ENOMEM; | 601 | return err; |
600 | if ((err = snd_card_cs4232_pnp(dev, card->private_data, pdev)) < 0) { | 602 | if ((err = snd_card_cs4232_pnp(dev, card->private_data, pdev)) < 0) { |
601 | printk(KERN_ERR "PnP BIOS detection failed for " IDENT "\n"); | 603 | printk(KERN_ERR "PnP BIOS detection failed for " IDENT "\n"); |
602 | snd_card_free(card); | 604 | snd_card_free(card); |
@@ -656,9 +658,9 @@ static int __devinit snd_cs423x_pnpc_detect(struct pnp_card_link *pcard, | |||
656 | if (dev >= SNDRV_CARDS) | 658 | if (dev >= SNDRV_CARDS) |
657 | return -ENODEV; | 659 | return -ENODEV; |
658 | 660 | ||
659 | card = snd_cs423x_card_new(dev); | 661 | res = snd_cs423x_card_new(dev, &card); |
660 | if (! card) | 662 | if (res < 0) |
661 | return -ENOMEM; | 663 | return res; |
662 | if ((res = snd_card_cs423x_pnpc(dev, card->private_data, pcard, pid)) < 0) { | 664 | if ((res = snd_card_cs423x_pnpc(dev, card->private_data, pcard, pid)) < 0) { |
663 | printk(KERN_ERR "isapnp detection failed and probing for " IDENT | 665 | printk(KERN_ERR "isapnp detection failed and probing for " IDENT |
664 | " is not supported\n"); | 666 | " is not supported\n"); |
diff --git a/sound/isa/dt019x.c b/sound/isa/dt019x.c index a0242c3b613e..80f5b1af9be8 100644 --- a/sound/isa/dt019x.c +++ b/sound/isa/dt019x.c | |||
@@ -150,9 +150,10 @@ static int __devinit snd_card_dt019x_probe(int dev, struct pnp_card_link *pcard, | |||
150 | struct snd_card_dt019x *acard; | 150 | struct snd_card_dt019x *acard; |
151 | struct snd_opl3 *opl3; | 151 | struct snd_opl3 *opl3; |
152 | 152 | ||
153 | if ((card = snd_card_new(index[dev], id[dev], THIS_MODULE, | 153 | error = snd_card_create(index[dev], id[dev], THIS_MODULE, |
154 | sizeof(struct snd_card_dt019x))) == NULL) | 154 | sizeof(struct snd_card_dt019x), &card); |
155 | return -ENOMEM; | 155 | if (error < 0) |
156 | return error; | ||
156 | acard = card->private_data; | 157 | acard = card->private_data; |
157 | 158 | ||
158 | snd_card_set_dev(card, &pcard->card->dev); | 159 | snd_card_set_dev(card, &pcard->card->dev); |
diff --git a/sound/isa/es1688/es1688.c b/sound/isa/es1688/es1688.c index b0eb0cf6050e..442b081cafb7 100644 --- a/sound/isa/es1688/es1688.c +++ b/sound/isa/es1688/es1688.c | |||
@@ -125,9 +125,9 @@ static int __devinit snd_es1688_probe(struct device *dev, unsigned int n) | |||
125 | struct snd_pcm *pcm; | 125 | struct snd_pcm *pcm; |
126 | int error; | 126 | int error; |
127 | 127 | ||
128 | card = snd_card_new(index[n], id[n], THIS_MODULE, 0); | 128 | error = snd_card_create(index[n], id[n], THIS_MODULE, 0, &card); |
129 | if (!card) | 129 | if (error < 0) |
130 | return -EINVAL; | 130 | return error; |
131 | 131 | ||
132 | error = snd_es1688_legacy_create(card, dev, n, &chip); | 132 | error = snd_es1688_legacy_create(card, dev, n, &chip); |
133 | if (error < 0) | 133 | if (error < 0) |
diff --git a/sound/isa/es18xx.c b/sound/isa/es18xx.c index 90498e4ca260..8cfbff73a835 100644 --- a/sound/isa/es18xx.c +++ b/sound/isa/es18xx.c | |||
@@ -2125,10 +2125,10 @@ static int __devinit snd_audiodrive_pnpc(int dev, struct snd_audiodrive *acard, | |||
2125 | #define is_isapnp_selected(dev) 0 | 2125 | #define is_isapnp_selected(dev) 0 |
2126 | #endif | 2126 | #endif |
2127 | 2127 | ||
2128 | static struct snd_card *snd_es18xx_card_new(int dev) | 2128 | static int snd_es18xx_card_new(int dev, struct snd_card **cardp) |
2129 | { | 2129 | { |
2130 | return snd_card_new(index[dev], id[dev], THIS_MODULE, | 2130 | return snd_card_create(index[dev], id[dev], THIS_MODULE, |
2131 | sizeof(struct snd_audiodrive)); | 2131 | sizeof(struct snd_audiodrive), cardp); |
2132 | } | 2132 | } |
2133 | 2133 | ||
2134 | static int __devinit snd_audiodrive_probe(struct snd_card *card, int dev) | 2134 | static int __devinit snd_audiodrive_probe(struct snd_card *card, int dev) |
@@ -2197,9 +2197,9 @@ static int __devinit snd_es18xx_isa_probe1(int dev, struct device *devptr) | |||
2197 | struct snd_card *card; | 2197 | struct snd_card *card; |
2198 | int err; | 2198 | int err; |
2199 | 2199 | ||
2200 | card = snd_es18xx_card_new(dev); | 2200 | err = snd_es18xx_card_new(dev, &card); |
2201 | if (! card) | 2201 | if (err < 0) |
2202 | return -ENOMEM; | 2202 | return err; |
2203 | snd_card_set_dev(card, devptr); | 2203 | snd_card_set_dev(card, devptr); |
2204 | if ((err = snd_audiodrive_probe(card, dev)) < 0) { | 2204 | if ((err = snd_audiodrive_probe(card, dev)) < 0) { |
2205 | snd_card_free(card); | 2205 | snd_card_free(card); |
@@ -2303,9 +2303,9 @@ static int __devinit snd_audiodrive_pnp_detect(struct pnp_dev *pdev, | |||
2303 | if (dev >= SNDRV_CARDS) | 2303 | if (dev >= SNDRV_CARDS) |
2304 | return -ENODEV; | 2304 | return -ENODEV; |
2305 | 2305 | ||
2306 | card = snd_es18xx_card_new(dev); | 2306 | err = snd_es18xx_card_new(dev, &card); |
2307 | if (! card) | 2307 | if (err < 0) |
2308 | return -ENOMEM; | 2308 | return err; |
2309 | if ((err = snd_audiodrive_pnp(dev, card->private_data, pdev)) < 0) { | 2309 | if ((err = snd_audiodrive_pnp(dev, card->private_data, pdev)) < 0) { |
2310 | snd_card_free(card); | 2310 | snd_card_free(card); |
2311 | return err; | 2311 | return err; |
@@ -2362,9 +2362,9 @@ static int __devinit snd_audiodrive_pnpc_detect(struct pnp_card_link *pcard, | |||
2362 | if (dev >= SNDRV_CARDS) | 2362 | if (dev >= SNDRV_CARDS) |
2363 | return -ENODEV; | 2363 | return -ENODEV; |
2364 | 2364 | ||
2365 | card = snd_es18xx_card_new(dev); | 2365 | res = snd_es18xx_card_new(dev, &card); |
2366 | if (! card) | 2366 | if (res < 0) |
2367 | return -ENOMEM; | 2367 | return res; |
2368 | 2368 | ||
2369 | if ((res = snd_audiodrive_pnpc(dev, card->private_data, pcard, pid)) < 0) { | 2369 | if ((res = snd_audiodrive_pnpc(dev, card->private_data, pcard, pid)) < 0) { |
2370 | snd_card_free(card); | 2370 | snd_card_free(card); |
diff --git a/sound/isa/gus/gusclassic.c b/sound/isa/gus/gusclassic.c index 426532a4d730..086b8f0e0f94 100644 --- a/sound/isa/gus/gusclassic.c +++ b/sound/isa/gus/gusclassic.c | |||
@@ -148,9 +148,9 @@ static int __devinit snd_gusclassic_probe(struct device *dev, unsigned int n) | |||
148 | struct snd_gus_card *gus; | 148 | struct snd_gus_card *gus; |
149 | int error; | 149 | int error; |
150 | 150 | ||
151 | card = snd_card_new(index[n], id[n], THIS_MODULE, 0); | 151 | error = snd_card_create(index[n], id[n], THIS_MODULE, 0, &card); |
152 | if (!card) | 152 | if (error < 0) |
153 | return -EINVAL; | 153 | return error; |
154 | 154 | ||
155 | if (pcm_channels[n] < 2) | 155 | if (pcm_channels[n] < 2) |
156 | pcm_channels[n] = 2; | 156 | pcm_channels[n] = 2; |
diff --git a/sound/isa/gus/gusextreme.c b/sound/isa/gus/gusextreme.c index 7ad4c3b41a84..180a8dea6bd9 100644 --- a/sound/isa/gus/gusextreme.c +++ b/sound/isa/gus/gusextreme.c | |||
@@ -241,9 +241,9 @@ static int __devinit snd_gusextreme_probe(struct device *dev, unsigned int n) | |||
241 | struct snd_opl3 *opl3; | 241 | struct snd_opl3 *opl3; |
242 | int error; | 242 | int error; |
243 | 243 | ||
244 | card = snd_card_new(index[n], id[n], THIS_MODULE, 0); | 244 | error = snd_card_create(index[n], id[n], THIS_MODULE, 0, &card); |
245 | if (!card) | 245 | if (error < 0) |
246 | return -EINVAL; | 246 | return error; |
247 | 247 | ||
248 | if (mpu_port[n] == SNDRV_AUTO_PORT) | 248 | if (mpu_port[n] == SNDRV_AUTO_PORT) |
249 | mpu_port[n] = 0; | 249 | mpu_port[n] = 0; |
diff --git a/sound/isa/gus/gusmax.c b/sound/isa/gus/gusmax.c index f94c1976e632..f26eac8d8110 100644 --- a/sound/isa/gus/gusmax.c +++ b/sound/isa/gus/gusmax.c | |||
@@ -214,10 +214,10 @@ static int __devinit snd_gusmax_probe(struct device *pdev, unsigned int dev) | |||
214 | struct snd_wss *wss; | 214 | struct snd_wss *wss; |
215 | struct snd_gusmax *maxcard; | 215 | struct snd_gusmax *maxcard; |
216 | 216 | ||
217 | card = snd_card_new(index[dev], id[dev], THIS_MODULE, | 217 | err = snd_card_create(index[dev], id[dev], THIS_MODULE, |
218 | sizeof(struct snd_gusmax)); | 218 | sizeof(struct snd_gusmax), &card); |
219 | if (card == NULL) | 219 | if (err < 0) |
220 | return -ENOMEM; | 220 | return err; |
221 | card->private_free = snd_gusmax_free; | 221 | card->private_free = snd_gusmax_free; |
222 | maxcard = (struct snd_gusmax *)card->private_data; | 222 | maxcard = (struct snd_gusmax *)card->private_data; |
223 | maxcard->card = card; | 223 | maxcard->card = card; |
diff --git a/sound/isa/gus/interwave.c b/sound/isa/gus/interwave.c index 418d49eef926..534a6eced2b8 100644 --- a/sound/isa/gus/interwave.c +++ b/sound/isa/gus/interwave.c | |||
@@ -628,20 +628,22 @@ static void snd_interwave_free(struct snd_card *card) | |||
628 | free_irq(iwcard->irq, (void *)iwcard); | 628 | free_irq(iwcard->irq, (void *)iwcard); |
629 | } | 629 | } |
630 | 630 | ||
631 | static struct snd_card *snd_interwave_card_new(int dev) | 631 | static int snd_interwave_card_new(int dev, struct snd_card **cardp) |
632 | { | 632 | { |
633 | struct snd_card *card; | 633 | struct snd_card *card; |
634 | struct snd_interwave *iwcard; | 634 | struct snd_interwave *iwcard; |
635 | int err; | ||
635 | 636 | ||
636 | card = snd_card_new(index[dev], id[dev], THIS_MODULE, | 637 | err = snd_card_create(index[dev], id[dev], THIS_MODULE, |
637 | sizeof(struct snd_interwave)); | 638 | sizeof(struct snd_interwave), &card); |
638 | if (card == NULL) | 639 | if (err < 0) |
639 | return NULL; | 640 | return err; |
640 | iwcard = card->private_data; | 641 | iwcard = card->private_data; |
641 | iwcard->card = card; | 642 | iwcard->card = card; |
642 | iwcard->irq = -1; | 643 | iwcard->irq = -1; |
643 | card->private_free = snd_interwave_free; | 644 | card->private_free = snd_interwave_free; |
644 | return card; | 645 | *cardp = card; |
646 | return 0; | ||
645 | } | 647 | } |
646 | 648 | ||
647 | static int __devinit snd_interwave_probe(struct snd_card *card, int dev) | 649 | static int __devinit snd_interwave_probe(struct snd_card *card, int dev) |
@@ -780,9 +782,9 @@ static int __devinit snd_interwave_isa_probe1(int dev, struct device *devptr) | |||
780 | struct snd_card *card; | 782 | struct snd_card *card; |
781 | int err; | 783 | int err; |
782 | 784 | ||
783 | card = snd_interwave_card_new(dev); | 785 | err = snd_interwave_card_new(dev, &card); |
784 | if (! card) | 786 | if (err < 0) |
785 | return -ENOMEM; | 787 | return err; |
786 | 788 | ||
787 | snd_card_set_dev(card, devptr); | 789 | snd_card_set_dev(card, devptr); |
788 | if ((err = snd_interwave_probe(card, dev)) < 0) { | 790 | if ((err = snd_interwave_probe(card, dev)) < 0) { |
@@ -878,9 +880,9 @@ static int __devinit snd_interwave_pnp_detect(struct pnp_card_link *pcard, | |||
878 | if (dev >= SNDRV_CARDS) | 880 | if (dev >= SNDRV_CARDS) |
879 | return -ENODEV; | 881 | return -ENODEV; |
880 | 882 | ||
881 | card = snd_interwave_card_new(dev); | 883 | res = snd_interwave_card_new(dev, &card); |
882 | if (! card) | 884 | if (res < 0) |
883 | return -ENOMEM; | 885 | return res; |
884 | 886 | ||
885 | if ((res = snd_interwave_pnp(dev, card->private_data, pcard, pid)) < 0) { | 887 | if ((res = snd_interwave_pnp(dev, card->private_data, pcard, pid)) < 0) { |
886 | snd_card_free(card); | 888 | snd_card_free(card); |
diff --git a/sound/isa/opl3sa2.c b/sound/isa/opl3sa2.c index 06810dfb9d9a..e8d6e1ac88a8 100644 --- a/sound/isa/opl3sa2.c +++ b/sound/isa/opl3sa2.c | |||
@@ -621,21 +621,24 @@ static void snd_opl3sa2_free(struct snd_card *card) | |||
621 | release_and_free_resource(chip->res_port); | 621 | release_and_free_resource(chip->res_port); |
622 | } | 622 | } |
623 | 623 | ||
624 | static struct snd_card *snd_opl3sa2_card_new(int dev) | 624 | static int snd_opl3sa2_card_new(int dev, struct snd_card **cardp) |
625 | { | 625 | { |
626 | struct snd_card *card; | 626 | struct snd_card *card; |
627 | struct snd_opl3sa2 *chip; | 627 | struct snd_opl3sa2 *chip; |
628 | int err; | ||
628 | 629 | ||
629 | card = snd_card_new(index[dev], id[dev], THIS_MODULE, sizeof(struct snd_opl3sa2)); | 630 | err = snd_card_create(index[dev], id[dev], THIS_MODULE, |
630 | if (card == NULL) | 631 | sizeof(struct snd_opl3sa2), &card); |
631 | return NULL; | 632 | if (err < 0) |
633 | return err; | ||
632 | strcpy(card->driver, "OPL3SA2"); | 634 | strcpy(card->driver, "OPL3SA2"); |
633 | strcpy(card->shortname, "Yamaha OPL3-SA2"); | 635 | strcpy(card->shortname, "Yamaha OPL3-SA2"); |
634 | chip = card->private_data; | 636 | chip = card->private_data; |
635 | spin_lock_init(&chip->reg_lock); | 637 | spin_lock_init(&chip->reg_lock); |
636 | chip->irq = -1; | 638 | chip->irq = -1; |
637 | card->private_free = snd_opl3sa2_free; | 639 | card->private_free = snd_opl3sa2_free; |
638 | return card; | 640 | *cardp = card; |
641 | return 0; | ||
639 | } | 642 | } |
640 | 643 | ||
641 | static int __devinit snd_opl3sa2_probe(struct snd_card *card, int dev) | 644 | static int __devinit snd_opl3sa2_probe(struct snd_card *card, int dev) |
@@ -727,9 +730,9 @@ static int __devinit snd_opl3sa2_pnp_detect(struct pnp_dev *pdev, | |||
727 | if (dev >= SNDRV_CARDS) | 730 | if (dev >= SNDRV_CARDS) |
728 | return -ENODEV; | 731 | return -ENODEV; |
729 | 732 | ||
730 | card = snd_opl3sa2_card_new(dev); | 733 | err = snd_opl3sa2_card_new(dev, &card); |
731 | if (! card) | 734 | if (err < 0) |
732 | return -ENOMEM; | 735 | return err; |
733 | if ((err = snd_opl3sa2_pnp(dev, card->private_data, pdev)) < 0) { | 736 | if ((err = snd_opl3sa2_pnp(dev, card->private_data, pdev)) < 0) { |
734 | snd_card_free(card); | 737 | snd_card_free(card); |
735 | return err; | 738 | return err; |
@@ -793,9 +796,9 @@ static int __devinit snd_opl3sa2_pnp_cdetect(struct pnp_card_link *pcard, | |||
793 | if (dev >= SNDRV_CARDS) | 796 | if (dev >= SNDRV_CARDS) |
794 | return -ENODEV; | 797 | return -ENODEV; |
795 | 798 | ||
796 | card = snd_opl3sa2_card_new(dev); | 799 | err = snd_opl3sa2_card_new(dev, &card); |
797 | if (! card) | 800 | if (err < 0) |
798 | return -ENOMEM; | 801 | return err; |
799 | if ((err = snd_opl3sa2_pnp(dev, card->private_data, pdev)) < 0) { | 802 | if ((err = snd_opl3sa2_pnp(dev, card->private_data, pdev)) < 0) { |
800 | snd_card_free(card); | 803 | snd_card_free(card); |
801 | return err; | 804 | return err; |
@@ -874,9 +877,9 @@ static int __devinit snd_opl3sa2_isa_probe(struct device *pdev, | |||
874 | struct snd_card *card; | 877 | struct snd_card *card; |
875 | int err; | 878 | int err; |
876 | 879 | ||
877 | card = snd_opl3sa2_card_new(dev); | 880 | err = snd_opl3sa2_card_new(dev, &card); |
878 | if (! card) | 881 | if (err < 0) |
879 | return -ENOMEM; | 882 | return err; |
880 | snd_card_set_dev(card, pdev); | 883 | snd_card_set_dev(card, pdev); |
881 | if ((err = snd_opl3sa2_probe(card, dev)) < 0) { | 884 | if ((err = snd_opl3sa2_probe(card, dev)) < 0) { |
882 | snd_card_free(card); | 885 | snd_card_free(card); |
diff --git a/sound/isa/opti9xx/miro.c b/sound/isa/opti9xx/miro.c index 440755cc0013..02e30d7c6a93 100644 --- a/sound/isa/opti9xx/miro.c +++ b/sound/isa/opti9xx/miro.c | |||
@@ -1228,9 +1228,10 @@ static int __devinit snd_miro_probe(struct device *devptr, unsigned int n) | |||
1228 | struct snd_pcm *pcm; | 1228 | struct snd_pcm *pcm; |
1229 | struct snd_rawmidi *rmidi; | 1229 | struct snd_rawmidi *rmidi; |
1230 | 1230 | ||
1231 | if (!(card = snd_card_new(index, id, THIS_MODULE, | 1231 | error = snd_card_create(index, id, THIS_MODULE, |
1232 | sizeof(struct snd_miro)))) | 1232 | sizeof(struct snd_miro), &card); |
1233 | return -ENOMEM; | 1233 | if (error < 0) |
1234 | return error; | ||
1234 | 1235 | ||
1235 | card->private_free = snd_card_miro_free; | 1236 | card->private_free = snd_card_miro_free; |
1236 | miro = card->private_data; | 1237 | miro = card->private_data; |
diff --git a/sound/isa/opti9xx/opti92x-ad1848.c b/sound/isa/opti9xx/opti92x-ad1848.c index d5bc0e03132a..5cd555325b9d 100644 --- a/sound/isa/opti9xx/opti92x-ad1848.c +++ b/sound/isa/opti9xx/opti92x-ad1848.c | |||
@@ -828,15 +828,18 @@ static int __devinit snd_opti9xx_probe(struct snd_card *card) | |||
828 | return snd_card_register(card); | 828 | return snd_card_register(card); |
829 | } | 829 | } |
830 | 830 | ||
831 | static struct snd_card *snd_opti9xx_card_new(void) | 831 | static int snd_opti9xx_card_new(struct snd_card **cardp) |
832 | { | 832 | { |
833 | struct snd_card *card; | 833 | struct snd_card *card; |
834 | int err; | ||
834 | 835 | ||
835 | card = snd_card_new(index, id, THIS_MODULE, sizeof(struct snd_opti9xx)); | 836 | err = snd_card_create(index, id, THIS_MODULE, |
836 | if (! card) | 837 | sizeof(struct snd_opti9xx), &card); |
837 | return NULL; | 838 | if (err < 0) |
839 | return err; | ||
838 | card->private_free = snd_card_opti9xx_free; | 840 | card->private_free = snd_card_opti9xx_free; |
839 | return card; | 841 | *cardp = card; |
842 | return 0; | ||
840 | } | 843 | } |
841 | 844 | ||
842 | static int __devinit snd_opti9xx_isa_match(struct device *devptr, | 845 | static int __devinit snd_opti9xx_isa_match(struct device *devptr, |
@@ -901,9 +904,9 @@ static int __devinit snd_opti9xx_isa_probe(struct device *devptr, | |||
901 | } | 904 | } |
902 | #endif | 905 | #endif |
903 | 906 | ||
904 | card = snd_opti9xx_card_new(); | 907 | error = snd_opti9xx_card_new(&card); |
905 | if (! card) | 908 | if (error < 0) |
906 | return -ENOMEM; | 909 | return error; |
907 | 910 | ||
908 | if ((error = snd_card_opti9xx_detect(card, card->private_data)) < 0) { | 911 | if ((error = snd_card_opti9xx_detect(card, card->private_data)) < 0) { |
909 | snd_card_free(card); | 912 | snd_card_free(card); |
@@ -948,9 +951,9 @@ static int __devinit snd_opti9xx_pnp_probe(struct pnp_card_link *pcard, | |||
948 | return -EBUSY; | 951 | return -EBUSY; |
949 | if (! isapnp) | 952 | if (! isapnp) |
950 | return -ENODEV; | 953 | return -ENODEV; |
951 | card = snd_opti9xx_card_new(); | 954 | error = snd_opti9xx_card_new(&card); |
952 | if (! card) | 955 | if (error < 0) |
953 | return -ENOMEM; | 956 | return error; |
954 | chip = card->private_data; | 957 | chip = card->private_data; |
955 | 958 | ||
956 | hw = snd_card_opti9xx_pnp(chip, pcard, pid); | 959 | hw = snd_card_opti9xx_pnp(chip, pcard, pid); |
diff --git a/sound/isa/sb/es968.c b/sound/isa/sb/es968.c index c8c8e214c843..cafc3a7316a8 100644 --- a/sound/isa/sb/es968.c +++ b/sound/isa/sb/es968.c | |||
@@ -108,9 +108,10 @@ static int __devinit snd_card_es968_probe(int dev, | |||
108 | struct snd_card *card; | 108 | struct snd_card *card; |
109 | struct snd_card_es968 *acard; | 109 | struct snd_card_es968 *acard; |
110 | 110 | ||
111 | if ((card = snd_card_new(index[dev], id[dev], THIS_MODULE, | 111 | error = snd_card_create(index[dev], id[dev], THIS_MODULE, |
112 | sizeof(struct snd_card_es968))) == NULL) | 112 | sizeof(struct snd_card_es968), &card); |
113 | return -ENOMEM; | 113 | if (error < 0) |
114 | return error; | ||
114 | acard = card->private_data; | 115 | acard = card->private_data; |
115 | if ((error = snd_card_es968_pnp(dev, acard, pcard, pid))) { | 116 | if ((error = snd_card_es968_pnp(dev, acard, pcard, pid))) { |
116 | snd_card_free(card); | 117 | snd_card_free(card); |
diff --git a/sound/isa/sb/sb16.c b/sound/isa/sb/sb16.c index 2c201f78ce50..519c36346dec 100644 --- a/sound/isa/sb/sb16.c +++ b/sound/isa/sb/sb16.c | |||
@@ -324,14 +324,18 @@ static void snd_sb16_free(struct snd_card *card) | |||
324 | #define is_isapnp_selected(dev) 0 | 324 | #define is_isapnp_selected(dev) 0 |
325 | #endif | 325 | #endif |
326 | 326 | ||
327 | static struct snd_card *snd_sb16_card_new(int dev) | 327 | static int snd_sb16_card_new(int dev, struct snd_card **cardp) |
328 | { | 328 | { |
329 | struct snd_card *card = snd_card_new(index[dev], id[dev], THIS_MODULE, | 329 | struct snd_card *card; |
330 | sizeof(struct snd_card_sb16)); | 330 | int err; |
331 | if (card == NULL) | 331 | |
332 | return NULL; | 332 | err = snd_card_create(index[dev], id[dev], THIS_MODULE, |
333 | sizeof(struct snd_card_sb16), &card); | ||
334 | if (err < 0) | ||
335 | return err; | ||
333 | card->private_free = snd_sb16_free; | 336 | card->private_free = snd_sb16_free; |
334 | return card; | 337 | *cardp = card; |
338 | return 0; | ||
335 | } | 339 | } |
336 | 340 | ||
337 | static int __devinit snd_sb16_probe(struct snd_card *card, int dev) | 341 | static int __devinit snd_sb16_probe(struct snd_card *card, int dev) |
@@ -489,9 +493,9 @@ static int __devinit snd_sb16_isa_probe1(int dev, struct device *pdev) | |||
489 | struct snd_card *card; | 493 | struct snd_card *card; |
490 | int err; | 494 | int err; |
491 | 495 | ||
492 | card = snd_sb16_card_new(dev); | 496 | err = snd_sb16_card_new(dev, &card); |
493 | if (! card) | 497 | if (err < 0) |
494 | return -ENOMEM; | 498 | return err; |
495 | 499 | ||
496 | acard = card->private_data; | 500 | acard = card->private_data; |
497 | /* non-PnP FM port address is hardwired with base port address */ | 501 | /* non-PnP FM port address is hardwired with base port address */ |
@@ -610,9 +614,9 @@ static int __devinit snd_sb16_pnp_detect(struct pnp_card_link *pcard, | |||
610 | for ( ; dev < SNDRV_CARDS; dev++) { | 614 | for ( ; dev < SNDRV_CARDS; dev++) { |
611 | if (!enable[dev] || !isapnp[dev]) | 615 | if (!enable[dev] || !isapnp[dev]) |
612 | continue; | 616 | continue; |
613 | card = snd_sb16_card_new(dev); | 617 | res = snd_sb16_card_new(dev, &card); |
614 | if (! card) | 618 | if (res < 0) |
615 | return -ENOMEM; | 619 | return res; |
616 | snd_card_set_dev(card, &pcard->card->dev); | 620 | snd_card_set_dev(card, &pcard->card->dev); |
617 | if ((res = snd_card_sb16_pnp(dev, card->private_data, pcard, pid)) < 0 || | 621 | if ((res = snd_card_sb16_pnp(dev, card->private_data, pcard, pid)) < 0 || |
618 | (res = snd_sb16_probe(card, dev)) < 0) { | 622 | (res = snd_sb16_probe(card, dev)) < 0) { |
diff --git a/sound/isa/sb/sb8.c b/sound/isa/sb/sb8.c index ea06877be4b1..3cd57ee54660 100644 --- a/sound/isa/sb/sb8.c +++ b/sound/isa/sb/sb8.c | |||
@@ -103,10 +103,10 @@ static int __devinit snd_sb8_probe(struct device *pdev, unsigned int dev) | |||
103 | struct snd_opl3 *opl3; | 103 | struct snd_opl3 *opl3; |
104 | int err; | 104 | int err; |
105 | 105 | ||
106 | card = snd_card_new(index[dev], id[dev], THIS_MODULE, | 106 | err = snd_card_create(index[dev], id[dev], THIS_MODULE, |
107 | sizeof(struct snd_sb8)); | 107 | sizeof(struct snd_sb8), &card); |
108 | if (card == NULL) | 108 | if (err < 0) |
109 | return -ENOMEM; | 109 | return err; |
110 | acard = card->private_data; | 110 | acard = card->private_data; |
111 | card->private_free = snd_sb8_free; | 111 | card->private_free = snd_sb8_free; |
112 | 112 | ||
diff --git a/sound/isa/sc6000.c b/sound/isa/sc6000.c index bbc53692e68d..782010608ef4 100644 --- a/sound/isa/sc6000.c +++ b/sound/isa/sc6000.c | |||
@@ -489,9 +489,9 @@ static int __devinit snd_sc6000_probe(struct device *devptr, unsigned int dev) | |||
489 | char __iomem *vmss_port; | 489 | char __iomem *vmss_port; |
490 | 490 | ||
491 | 491 | ||
492 | card = snd_card_new(index[dev], id[dev], THIS_MODULE, 0); | 492 | err = snd_card_create(index[dev], id[dev], THIS_MODULE, 0, &card); |
493 | if (!card) | 493 | if (err < 0) |
494 | return -ENOMEM; | 494 | return err; |
495 | 495 | ||
496 | if (xirq == SNDRV_AUTO_IRQ) { | 496 | if (xirq == SNDRV_AUTO_IRQ) { |
497 | xirq = snd_legacy_find_free_irq(possible_irqs); | 497 | xirq = snd_legacy_find_free_irq(possible_irqs); |
diff --git a/sound/isa/sgalaxy.c b/sound/isa/sgalaxy.c index 2c7503bf1271..6fe27b9d9440 100644 --- a/sound/isa/sgalaxy.c +++ b/sound/isa/sgalaxy.c | |||
@@ -243,9 +243,9 @@ static int __devinit snd_sgalaxy_probe(struct device *devptr, unsigned int dev) | |||
243 | struct snd_card *card; | 243 | struct snd_card *card; |
244 | struct snd_wss *chip; | 244 | struct snd_wss *chip; |
245 | 245 | ||
246 | card = snd_card_new(index[dev], id[dev], THIS_MODULE, 0); | 246 | err = snd_card_create(index[dev], id[dev], THIS_MODULE, 0, &card); |
247 | if (card == NULL) | 247 | if (err < 0) |
248 | return -ENOMEM; | 248 | return err; |
249 | 249 | ||
250 | xirq = irq[dev]; | 250 | xirq = irq[dev]; |
251 | if (xirq == SNDRV_AUTO_IRQ) { | 251 | if (xirq == SNDRV_AUTO_IRQ) { |
diff --git a/sound/isa/sscape.c b/sound/isa/sscape.c index 48a16d865834..4025fb558c50 100644 --- a/sound/isa/sscape.c +++ b/sound/isa/sscape.c | |||
@@ -1357,10 +1357,10 @@ static int __devinit snd_sscape_probe(struct device *pdev, unsigned int dev) | |||
1357 | struct soundscape *sscape; | 1357 | struct soundscape *sscape; |
1358 | int ret; | 1358 | int ret; |
1359 | 1359 | ||
1360 | card = snd_card_new(index[dev], id[dev], THIS_MODULE, | 1360 | ret = snd_card_create(index[dev], id[dev], THIS_MODULE, |
1361 | sizeof(struct soundscape)); | 1361 | sizeof(struct soundscape), &card); |
1362 | if (!card) | 1362 | if (ret < 0) |
1363 | return -ENOMEM; | 1363 | return ret; |
1364 | 1364 | ||
1365 | sscape = get_card_soundscape(card); | 1365 | sscape = get_card_soundscape(card); |
1366 | sscape->type = SSCAPE; | 1366 | sscape->type = SSCAPE; |
@@ -1462,10 +1462,10 @@ static int __devinit sscape_pnp_detect(struct pnp_card_link *pcard, | |||
1462 | * Create a new ALSA sound card entry, in anticipation | 1462 | * Create a new ALSA sound card entry, in anticipation |
1463 | * of detecting our hardware ... | 1463 | * of detecting our hardware ... |
1464 | */ | 1464 | */ |
1465 | card = snd_card_new(index[idx], id[idx], THIS_MODULE, | 1465 | ret = snd_card_create(index[idx], id[idx], THIS_MODULE, |
1466 | sizeof(struct soundscape)); | 1466 | sizeof(struct soundscape), &card); |
1467 | if (!card) | 1467 | if (ret < 0) |
1468 | return -ENOMEM; | 1468 | return ret; |
1469 | 1469 | ||
1470 | sscape = get_card_soundscape(card); | 1470 | sscape = get_card_soundscape(card); |
1471 | 1471 | ||
diff --git a/sound/isa/wavefront/wavefront.c b/sound/isa/wavefront/wavefront.c index c280e6220aee..a34ae7b1f7d0 100644 --- a/sound/isa/wavefront/wavefront.c +++ b/sound/isa/wavefront/wavefront.c | |||
@@ -338,15 +338,16 @@ snd_wavefront_free(struct snd_card *card) | |||
338 | } | 338 | } |
339 | } | 339 | } |
340 | 340 | ||
341 | static struct snd_card *snd_wavefront_card_new(int dev) | 341 | static int snd_wavefront_card_new(int dev, struct snd_card **cardp) |
342 | { | 342 | { |
343 | struct snd_card *card; | 343 | struct snd_card *card; |
344 | snd_wavefront_card_t *acard; | 344 | snd_wavefront_card_t *acard; |
345 | int err; | ||
345 | 346 | ||
346 | card = snd_card_new (index[dev], id[dev], THIS_MODULE, | 347 | err = snd_card_create(index[dev], id[dev], THIS_MODULE, |
347 | sizeof(snd_wavefront_card_t)); | 348 | sizeof(snd_wavefront_card_t), &card); |
348 | if (card == NULL) | 349 | if (err < 0) |
349 | return NULL; | 350 | return err; |
350 | 351 | ||
351 | acard = card->private_data; | 352 | acard = card->private_data; |
352 | acard->wavefront.irq = -1; | 353 | acard->wavefront.irq = -1; |
@@ -357,7 +358,8 @@ static struct snd_card *snd_wavefront_card_new(int dev) | |||
357 | acard->wavefront.card = card; | 358 | acard->wavefront.card = card; |
358 | card->private_free = snd_wavefront_free; | 359 | card->private_free = snd_wavefront_free; |
359 | 360 | ||
360 | return card; | 361 | *cardp = card; |
362 | return 0; | ||
361 | } | 363 | } |
362 | 364 | ||
363 | static int __devinit | 365 | static int __devinit |
@@ -567,9 +569,9 @@ static int __devinit snd_wavefront_isa_probe(struct device *pdev, | |||
567 | struct snd_card *card; | 569 | struct snd_card *card; |
568 | int err; | 570 | int err; |
569 | 571 | ||
570 | card = snd_wavefront_card_new(dev); | 572 | err = snd_wavefront_card_new(dev, &card); |
571 | if (! card) | 573 | if (err < 0) |
572 | return -ENOMEM; | 574 | return err; |
573 | snd_card_set_dev(card, pdev); | 575 | snd_card_set_dev(card, pdev); |
574 | if ((err = snd_wavefront_probe(card, dev)) < 0) { | 576 | if ((err = snd_wavefront_probe(card, dev)) < 0) { |
575 | snd_card_free(card); | 577 | snd_card_free(card); |
@@ -616,9 +618,9 @@ static int __devinit snd_wavefront_pnp_detect(struct pnp_card_link *pcard, | |||
616 | if (dev >= SNDRV_CARDS) | 618 | if (dev >= SNDRV_CARDS) |
617 | return -ENODEV; | 619 | return -ENODEV; |
618 | 620 | ||
619 | card = snd_wavefront_card_new(dev); | 621 | res = snd_wavefront_card_new(dev, &card); |
620 | if (! card) | 622 | if (res < 0) |
621 | return -ENOMEM; | 623 | return res; |
622 | 624 | ||
623 | if (snd_wavefront_pnp (dev, card->private_data, pcard, pid) < 0) { | 625 | if (snd_wavefront_pnp (dev, card->private_data, pcard, pid) < 0) { |
624 | if (cs4232_pcm_port[dev] == SNDRV_AUTO_PORT) { | 626 | if (cs4232_pcm_port[dev] == SNDRV_AUTO_PORT) { |