aboutsummaryrefslogtreecommitdiffstats
path: root/sound/isa
diff options
context:
space:
mode:
Diffstat (limited to 'sound/isa')
-rw-r--r--sound/isa/ad1816a/ad1816a.c7
-rw-r--r--sound/isa/ad1848/ad1848.c6
-rw-r--r--sound/isa/adlib.c6
-rw-r--r--sound/isa/als100.c7
-rw-r--r--sound/isa/azt2320.c7
-rw-r--r--sound/isa/cmi8330.c26
-rw-r--r--sound/isa/cs423x/cs4231.c6
-rw-r--r--sound/isa/cs423x/cs4236.c32
-rw-r--r--sound/isa/dt019x.c7
-rw-r--r--sound/isa/es1688/es1688.c6
-rw-r--r--sound/isa/es18xx.c24
-rw-r--r--sound/isa/gus/gusclassic.c6
-rw-r--r--sound/isa/gus/gusextreme.c6
-rw-r--r--sound/isa/gus/gusmax.c8
-rw-r--r--sound/isa/gus/interwave.c26
-rw-r--r--sound/isa/opl3sa2.c31
-rw-r--r--sound/isa/opti9xx/miro.c7
-rw-r--r--sound/isa/opti9xx/opti92x-ad1848.c25
-rw-r--r--sound/isa/sb/es968.c7
-rw-r--r--sound/isa/sb/sb16.c28
-rw-r--r--sound/isa/sb/sb8.c8
-rw-r--r--sound/isa/sc6000.c6
-rw-r--r--sound/isa/sgalaxy.c6
-rw-r--r--sound/isa/sscape.c16
-rw-r--r--sound/isa/wavefront/wavefront.c26
25 files changed, 182 insertions, 158 deletions
diff --git a/sound/isa/ad1816a/ad1816a.c b/sound/isa/ad1816a/ad1816a.c
index 77524244a846..9660e598232c 100644
--- a/sound/isa/ad1816a/ad1816a.c
+++ b/sound/isa/ad1816a/ad1816a.c
@@ -157,9 +157,10 @@ static int __devinit snd_card_ad1816a_probe(int dev, struct pnp_card_link *pcard
157 struct snd_ad1816a *chip; 157 struct snd_ad1816a *chip;
158 struct snd_opl3 *opl3; 158 struct snd_opl3 *opl3;
159 159
160 if ((card = snd_card_new(index[dev], id[dev], THIS_MODULE, 160 error = snd_card_create(index[dev], id[dev], THIS_MODULE,
161 sizeof(struct snd_card_ad1816a))) == NULL) 161 sizeof(struct snd_card_ad1816a), &card);
162 return -ENOMEM; 162 if (error < 0)
163 return error;
163 acard = (struct snd_card_ad1816a *)card->private_data; 164 acard = (struct snd_card_ad1816a *)card->private_data;
164 165
165 if ((error = snd_card_ad1816a_pnp(dev, acard, pcard, pid))) { 166 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 e49aec700a55..24e60902f8ca 100644
--- a/sound/isa/cmi8330.c
+++ b/sound/isa/cmi8330.c
@@ -467,20 +467,22 @@ static int snd_cmi8330_resume(struct snd_card *card)
467 467
468#define PFX "cmi8330: " 468#define PFX "cmi8330: "
469 469
470static struct snd_card *snd_cmi8330_card_new(int dev) 470static int snd_cmi8330_card_new(int dev, struct snd_card **cardp)
471{ 471{
472 struct snd_card *card; 472 struct snd_card *card;
473 struct snd_cmi8330 *acard; 473 struct snd_cmi8330 *acard;
474 int err;
474 475
475 card = snd_card_new(index[dev], id[dev], THIS_MODULE, 476 err = snd_card_create(index[dev], id[dev], THIS_MODULE,
476 sizeof(struct snd_cmi8330)); 477 sizeof(struct snd_cmi8330), &card);
477 if (card == NULL) { 478 if (err < 0) {
478 snd_printk(KERN_ERR PFX "could not get a new card\n"); 479 snd_printk(KERN_ERR PFX "could not get a new card\n");
479 return NULL; 480 return err;
480 } 481 }
481 acard = card->private_data; 482 acard = card->private_data;
482 acard->card = card; 483 acard->card = card;
483 return card; 484 *cardp = card;
485 return 0;
484} 486}
485 487
486static int __devinit snd_cmi8330_probe(struct snd_card *card, int dev) 488static int __devinit snd_cmi8330_probe(struct snd_card *card, int dev)
@@ -564,9 +566,9 @@ static int __devinit snd_cmi8330_isa_probe(struct device *pdev,
564 struct snd_card *card; 566 struct snd_card *card;
565 int err; 567 int err;
566 568
567 card = snd_cmi8330_card_new(dev); 569 err = snd_cmi8330_card_new(dev, &card);
568 if (! card) 570 if (err < 0)
569 return -ENOMEM; 571 return err;
570 snd_card_set_dev(card, pdev); 572 snd_card_set_dev(card, pdev);
571 if ((err = snd_cmi8330_probe(card, dev)) < 0) { 573 if ((err = snd_cmi8330_probe(card, dev)) < 0) {
572 snd_card_free(card); 574 snd_card_free(card);
@@ -628,9 +630,9 @@ static int __devinit snd_cmi8330_pnp_detect(struct pnp_card_link *pcard,
628 if (dev >= SNDRV_CARDS) 630 if (dev >= SNDRV_CARDS)
629 return -ENODEV; 631 return -ENODEV;
630 632
631 card = snd_cmi8330_card_new(dev); 633 res = snd_cmi8330_card_new(dev, &card);
632 if (! card) 634 if (res < 0)
633 return -ENOMEM; 635 return res;
634 if ((res = snd_cmi8330_pnp(dev, card->private_data, pcard, pid)) < 0) { 636 if ((res = snd_cmi8330_pnp(dev, card->private_data, pcard, pid)) < 0) {
635 snd_printk(KERN_ERR PFX "PnP detection failed\n"); 637 snd_printk(KERN_ERR PFX "PnP detection failed\n");
636 snd_card_free(card); 638 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
385static struct snd_card *snd_cs423x_card_new(int dev) 385static 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
397static int __devinit snd_cs423x_probe(struct snd_card *card, int dev) 399static 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 b46377139cf8..d746750410ea 100644
--- a/sound/isa/es1688/es1688.c
+++ b/sound/isa/es1688/es1688.c
@@ -122,9 +122,9 @@ static int __devinit snd_es1688_probe(struct device *dev, unsigned int n)
122 struct snd_pcm *pcm; 122 struct snd_pcm *pcm;
123 int error; 123 int error;
124 124
125 card = snd_card_new(index[n], id[n], THIS_MODULE, 0); 125 error = snd_card_create(index[n], id[n], THIS_MODULE, 0, &card);
126 if (!card) 126 if (error < 0)
127 return -EINVAL; 127 return error;
128 128
129 error = snd_es1688_legacy_create(card, dev, n, &chip); 129 error = snd_es1688_legacy_create(card, dev, n, &chip);
130 if (error < 0) 130 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
2128static struct snd_card *snd_es18xx_card_new(int dev) 2128static 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
2134static int __devinit snd_audiodrive_probe(struct snd_card *card, int dev) 2134static 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 5faecfb602d3..50e429a120da 100644
--- a/sound/isa/gus/interwave.c
+++ b/sound/isa/gus/interwave.c
@@ -626,20 +626,22 @@ static void snd_interwave_free(struct snd_card *card)
626 free_irq(iwcard->irq, (void *)iwcard); 626 free_irq(iwcard->irq, (void *)iwcard);
627} 627}
628 628
629static struct snd_card *snd_interwave_card_new(int dev) 629static int snd_interwave_card_new(int dev, struct snd_card **cardp)
630{ 630{
631 struct snd_card *card; 631 struct snd_card *card;
632 struct snd_interwave *iwcard; 632 struct snd_interwave *iwcard;
633 int err;
633 634
634 card = snd_card_new(index[dev], id[dev], THIS_MODULE, 635 err = snd_card_create(index[dev], id[dev], THIS_MODULE,
635 sizeof(struct snd_interwave)); 636 sizeof(struct snd_interwave), &card);
636 if (card == NULL) 637 if (err < 0)
637 return NULL; 638 return err;
638 iwcard = card->private_data; 639 iwcard = card->private_data;
639 iwcard->card = card; 640 iwcard->card = card;
640 iwcard->irq = -1; 641 iwcard->irq = -1;
641 card->private_free = snd_interwave_free; 642 card->private_free = snd_interwave_free;
642 return card; 643 *cardp = card;
644 return 0;
643} 645}
644 646
645static int __devinit snd_interwave_probe(struct snd_card *card, int dev) 647static int __devinit snd_interwave_probe(struct snd_card *card, int dev)
@@ -778,9 +780,9 @@ static int __devinit snd_interwave_isa_probe1(int dev, struct device *devptr)
778 struct snd_card *card; 780 struct snd_card *card;
779 int err; 781 int err;
780 782
781 card = snd_interwave_card_new(dev); 783 err = snd_interwave_card_new(dev, &card);
782 if (! card) 784 if (err < 0)
783 return -ENOMEM; 785 return err;
784 786
785 snd_card_set_dev(card, devptr); 787 snd_card_set_dev(card, devptr);
786 if ((err = snd_interwave_probe(card, dev)) < 0) { 788 if ((err = snd_interwave_probe(card, dev)) < 0) {
@@ -876,9 +878,9 @@ static int __devinit snd_interwave_pnp_detect(struct pnp_card_link *pcard,
876 if (dev >= SNDRV_CARDS) 878 if (dev >= SNDRV_CARDS)
877 return -ENODEV; 879 return -ENODEV;
878 880
879 card = snd_interwave_card_new(dev); 881 res = snd_interwave_card_new(dev, &card);
880 if (! card) 882 if (res < 0)
881 return -ENOMEM; 883 return res;
882 884
883 if ((res = snd_interwave_pnp(dev, card->private_data, pcard, pid)) < 0) { 885 if ((res = snd_interwave_pnp(dev, card->private_data, pcard, pid)) < 0) {
884 snd_card_free(card); 886 snd_card_free(card);
diff --git a/sound/isa/opl3sa2.c b/sound/isa/opl3sa2.c
index 58c972b2af03..645491a53023 100644
--- a/sound/isa/opl3sa2.c
+++ b/sound/isa/opl3sa2.c
@@ -617,21 +617,24 @@ static void snd_opl3sa2_free(struct snd_card *card)
617 release_and_free_resource(chip->res_port); 617 release_and_free_resource(chip->res_port);
618} 618}
619 619
620static struct snd_card *snd_opl3sa2_card_new(int dev) 620static int snd_opl3sa2_card_new(int dev, struct snd_card **cardp)
621{ 621{
622 struct snd_card *card; 622 struct snd_card *card;
623 struct snd_opl3sa2 *chip; 623 struct snd_opl3sa2 *chip;
624 int err;
624 625
625 card = snd_card_new(index[dev], id[dev], THIS_MODULE, sizeof(struct snd_opl3sa2)); 626 err = snd_card_create(index[dev], id[dev], THIS_MODULE,
626 if (card == NULL) 627 sizeof(struct snd_opl3sa2), &card);
627 return NULL; 628 if (err < 0)
629 return err;
628 strcpy(card->driver, "OPL3SA2"); 630 strcpy(card->driver, "OPL3SA2");
629 strcpy(card->shortname, "Yamaha OPL3-SA2"); 631 strcpy(card->shortname, "Yamaha OPL3-SA2");
630 chip = card->private_data; 632 chip = card->private_data;
631 spin_lock_init(&chip->reg_lock); 633 spin_lock_init(&chip->reg_lock);
632 chip->irq = -1; 634 chip->irq = -1;
633 card->private_free = snd_opl3sa2_free; 635 card->private_free = snd_opl3sa2_free;
634 return card; 636 *cardp = card;
637 return 0;
635} 638}
636 639
637static int __devinit snd_opl3sa2_probe(struct snd_card *card, int dev) 640static int __devinit snd_opl3sa2_probe(struct snd_card *card, int dev)
@@ -723,9 +726,9 @@ static int __devinit snd_opl3sa2_pnp_detect(struct pnp_dev *pdev,
723 if (dev >= SNDRV_CARDS) 726 if (dev >= SNDRV_CARDS)
724 return -ENODEV; 727 return -ENODEV;
725 728
726 card = snd_opl3sa2_card_new(dev); 729 err = snd_opl3sa2_card_new(dev, &card);
727 if (! card) 730 if (err < 0)
728 return -ENOMEM; 731 return err;
729 if ((err = snd_opl3sa2_pnp(dev, card->private_data, pdev)) < 0) { 732 if ((err = snd_opl3sa2_pnp(dev, card->private_data, pdev)) < 0) {
730 snd_card_free(card); 733 snd_card_free(card);
731 return err; 734 return err;
@@ -789,9 +792,9 @@ static int __devinit snd_opl3sa2_pnp_cdetect(struct pnp_card_link *pcard,
789 if (dev >= SNDRV_CARDS) 792 if (dev >= SNDRV_CARDS)
790 return -ENODEV; 793 return -ENODEV;
791 794
792 card = snd_opl3sa2_card_new(dev); 795 err = snd_opl3sa2_card_new(dev, &card);
793 if (! card) 796 if (err < 0)
794 return -ENOMEM; 797 return err;
795 if ((err = snd_opl3sa2_pnp(dev, card->private_data, pdev)) < 0) { 798 if ((err = snd_opl3sa2_pnp(dev, card->private_data, pdev)) < 0) {
796 snd_card_free(card); 799 snd_card_free(card);
797 return err; 800 return err;
@@ -870,9 +873,9 @@ static int __devinit snd_opl3sa2_isa_probe(struct device *pdev,
870 struct snd_card *card; 873 struct snd_card *card;
871 int err; 874 int err;
872 875
873 card = snd_opl3sa2_card_new(dev); 876 err = snd_opl3sa2_card_new(dev, &card);
874 if (! card) 877 if (err < 0)
875 return -ENOMEM; 878 return err;
876 snd_card_set_dev(card, pdev); 879 snd_card_set_dev(card, pdev);
877 if ((err = snd_opl3sa2_probe(card, dev)) < 0) { 880 if ((err = snd_opl3sa2_probe(card, dev)) < 0) {
878 snd_card_free(card); 881 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 19706b0d8497..cd6e60a6a4ea 100644
--- a/sound/isa/opti9xx/opti92x-ad1848.c
+++ b/sound/isa/opti9xx/opti92x-ad1848.c
@@ -830,15 +830,18 @@ static int __devinit snd_opti9xx_probe(struct snd_card *card)
830 return snd_card_register(card); 830 return snd_card_register(card);
831} 831}
832 832
833static struct snd_card *snd_opti9xx_card_new(void) 833static int snd_opti9xx_card_new(struct snd_card **cardp)
834{ 834{
835 struct snd_card *card; 835 struct snd_card *card;
836 int err;
836 837
837 card = snd_card_new(index, id, THIS_MODULE, sizeof(struct snd_opti9xx)); 838 err = snd_card_create(index, id, THIS_MODULE,
838 if (! card) 839 sizeof(struct snd_opti9xx), &card);
839 return NULL; 840 if (err < 0)
841 return err;
840 card->private_free = snd_card_opti9xx_free; 842 card->private_free = snd_card_opti9xx_free;
841 return card; 843 *cardp = card;
844 return 0;
842} 845}
843 846
844static int __devinit snd_opti9xx_isa_match(struct device *devptr, 847static int __devinit snd_opti9xx_isa_match(struct device *devptr,
@@ -903,9 +906,9 @@ static int __devinit snd_opti9xx_isa_probe(struct device *devptr,
903 } 906 }
904#endif 907#endif
905 908
906 card = snd_opti9xx_card_new(); 909 error = snd_opti9xx_card_new(&card);
907 if (! card) 910 if (error < 0)
908 return -ENOMEM; 911 return error;
909 912
910 if ((error = snd_card_opti9xx_detect(card, card->private_data)) < 0) { 913 if ((error = snd_card_opti9xx_detect(card, card->private_data)) < 0) {
911 snd_card_free(card); 914 snd_card_free(card);
@@ -950,9 +953,9 @@ static int __devinit snd_opti9xx_pnp_probe(struct pnp_card_link *pcard,
950 return -EBUSY; 953 return -EBUSY;
951 if (! isapnp) 954 if (! isapnp)
952 return -ENODEV; 955 return -ENODEV;
953 card = snd_opti9xx_card_new(); 956 error = snd_opti9xx_card_new(&card);
954 if (! card) 957 if (error < 0)
955 return -ENOMEM; 958 return error;
956 chip = card->private_data; 959 chip = card->private_data;
957 960
958 hw = snd_card_opti9xx_pnp(chip, pcard, pid); 961 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
327static struct snd_card *snd_sb16_card_new(int dev) 327static 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
337static int __devinit snd_sb16_probe(struct snd_card *card, int dev) 341static 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 ca35924dc3b3..7a1470376c6d 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 4c095bc7c729..95898b2b7b58 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
341static struct snd_card *snd_wavefront_card_new(int dev) 341static 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
363static int __devinit 365static 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) {