aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@alsa3.local>2008-12-28 10:43:35 -0500
committerTakashi Iwai <tiwai@suse.de>2009-01-12 09:20:26 -0500
commitc95eadd2f1afd2ba643e85a8dfc9079a3f03ae47 (patch)
tree1fb2defba2bf3d4c299395b0f46d7902eb3b51ba
parent53fb1e63599438bd5f6fbb852023d80916d83983 (diff)
ALSA: Convert to snd_card_create() in sound/isa/*
Convert from snd_card_new() to the new snd_card_create() function. Signed-off-by: Takashi Iwai <tiwai@suse.de>
-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.c7
-rw-r--r--sound/isa/dt019x.c7
-rw-r--r--sound/isa/es1688/es1688.c6
-rw-r--r--sound/isa/es18xx.c7
-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.c7
-rw-r--r--sound/isa/opl3sa2.c31
-rw-r--r--sound/isa/opti9xx/miro.c7
-rw-r--r--sound/isa/opti9xx/opti92x-ad1848.c6
-rw-r--r--sound/isa/sb/es968.c7
-rw-r--r--sound/isa/sb/sb16.c9
-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.c7
25 files changed, 122 insertions, 100 deletions
diff --git a/sound/isa/ad1816a/ad1816a.c b/sound/isa/ad1816a/ad1816a.c
index 77524244a84..9660e598232 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 223a6c03881..4beeb6f98e0 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 374b7177e11..7465ae036e0 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 f1ce30f379c..5fd52e4d707 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 3e74d1a3928..f7aa637b0d1 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 e49aec700a5..24e60902f8c 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 f019d449e2d..cb9153e75b8 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 019c9401663..db830682804 100644
--- a/sound/isa/cs423x/cs4236.c
+++ b/sound/isa/cs423x/cs4236.c
@@ -385,10 +385,11 @@ static void snd_card_cs4236_free(struct snd_card *card)
385static struct snd_card *snd_cs423x_card_new(int dev) 385static struct snd_card *snd_cs423x_card_new(int dev)
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 NULL;
393 card->private_free = snd_card_cs4236_free; 394 card->private_free = snd_card_cs4236_free;
394 return card; 395 return card;
diff --git a/sound/isa/dt019x.c b/sound/isa/dt019x.c
index a0242c3b613..80f5b1af9be 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 b46377139cf..d746750410e 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 90498e4ca26..c24c6322fcc 100644
--- a/sound/isa/es18xx.c
+++ b/sound/isa/es18xx.c
@@ -2127,8 +2127,11 @@ static int __devinit snd_audiodrive_pnpc(int dev, struct snd_audiodrive *acard,
2127 2127
2128static struct snd_card *snd_es18xx_card_new(int dev) 2128static struct snd_card *snd_es18xx_card_new(int dev)
2129{ 2129{
2130 return snd_card_new(index[dev], id[dev], THIS_MODULE, 2130 struct snd_card *card;
2131 sizeof(struct snd_audiodrive)); 2131 if (snd_card_create(index[dev], id[dev], THIS_MODULE,
2132 sizeof(struct snd_audiodrive), &card) < 0)
2133 return NULL;
2134 return card;
2132} 2135}
2133 2136
2134static int __devinit snd_audiodrive_probe(struct snd_card *card, int dev) 2137static int __devinit snd_audiodrive_probe(struct snd_card *card, int dev)
diff --git a/sound/isa/gus/gusclassic.c b/sound/isa/gus/gusclassic.c
index 426532a4d73..086b8f0e0f9 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 7ad4c3b41a8..180a8dea6bd 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 f94c1976e63..f26eac8d811 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 5faecfb602d..e040c763891 100644
--- a/sound/isa/gus/interwave.c
+++ b/sound/isa/gus/interwave.c
@@ -630,10 +630,11 @@ static struct snd_card *snd_interwave_card_new(int dev)
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 NULL;
638 iwcard = card->private_data; 639 iwcard = card->private_data;
639 iwcard->card = card; 640 iwcard->card = card;
diff --git a/sound/isa/opl3sa2.c b/sound/isa/opl3sa2.c
index 58c972b2af0..645491a5302 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 440755cc001..02e30d7c6a9 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 19706b0d849..5750f38bb79 100644
--- a/sound/isa/opti9xx/opti92x-ad1848.c
+++ b/sound/isa/opti9xx/opti92x-ad1848.c
@@ -833,9 +833,11 @@ static int __devinit snd_opti9xx_probe(struct snd_card *card)
833static struct snd_card *snd_opti9xx_card_new(void) 833static struct snd_card *snd_opti9xx_card_new(void)
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);
840 if (err < 0)
839 return NULL; 841 return NULL;
840 card->private_free = snd_card_opti9xx_free; 842 card->private_free = snd_card_opti9xx_free;
841 return card; 843 return card;
diff --git a/sound/isa/sb/es968.c b/sound/isa/sb/es968.c
index c8c8e214c84..cafc3a7316a 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 2c201f78ce5..adf4fdd2c4a 100644
--- a/sound/isa/sb/sb16.c
+++ b/sound/isa/sb/sb16.c
@@ -326,9 +326,12 @@ static void snd_sb16_free(struct snd_card *card)
326 326
327static struct snd_card *snd_sb16_card_new(int dev) 327static struct snd_card *snd_sb16_card_new(int dev)
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 err = snd_card_create(index[dev], id[dev], THIS_MODULE,
333 sizeof(struct snd_card_sb16), &card);
334 if (err < 0)
332 return NULL; 335 return NULL;
333 card->private_free = snd_sb16_free; 336 card->private_free = snd_sb16_free;
334 return card; 337 return card;
diff --git a/sound/isa/sb/sb8.c b/sound/isa/sb/sb8.c
index ea06877be4b..3cd57ee5466 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 ca35924dc3b..7a1470376c6 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 2c7503bf127..6fe27b9d944 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 48a16d86583..4025fb558c5 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 4c095bc7c72..82b8fb74690 100644
--- a/sound/isa/wavefront/wavefront.c
+++ b/sound/isa/wavefront/wavefront.c
@@ -342,10 +342,11 @@ static struct snd_card *snd_wavefront_card_new(int dev)
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 NULL;
350 351
351 acard = card->private_data; 352 acard = card->private_data;