aboutsummaryrefslogtreecommitdiffstats
path: root/sound/isa
diff options
context:
space:
mode:
Diffstat (limited to 'sound/isa')
-rw-r--r--sound/isa/ad1816a/ad1816a.c12
-rw-r--r--sound/isa/als100.c14
-rw-r--r--sound/isa/azt2320.c12
-rw-r--r--sound/isa/cmi8330.c15
-rw-r--r--sound/isa/cs423x/cs4236.c25
-rw-r--r--sound/isa/dt019x.c12
-rw-r--r--sound/isa/es18xx.c13
-rw-r--r--sound/isa/gus/interwave.c12
-rw-r--r--sound/isa/opl3sa2.c17
-rw-r--r--sound/isa/sb/es968.c12
-rw-r--r--sound/isa/sb/sb16.c14
-rw-r--r--sound/isa/sscape.c4
-rw-r--r--sound/isa/wavefront/wavefront.c10
13 files changed, 106 insertions, 66 deletions
diff --git a/sound/isa/ad1816a/ad1816a.c b/sound/isa/ad1816a/ad1816a.c
index 7051f7798ed7..31f299aed281 100644
--- a/sound/isa/ad1816a/ad1816a.c
+++ b/sound/isa/ad1816a/ad1816a.c
@@ -262,6 +262,8 @@ static int __devinit snd_card_ad1816a_probe(int dev, struct pnp_card_link *pcard
262 return 0; 262 return 0;
263} 263}
264 264
265static unsigned int __devinitdata ad1816a_devices;
266
265static int __devinit snd_ad1816a_pnp_detect(struct pnp_card_link *card, 267static int __devinit snd_ad1816a_pnp_detect(struct pnp_card_link *card,
266 const struct pnp_card_device_id *id) 268 const struct pnp_card_device_id *id)
267{ 269{
@@ -275,6 +277,7 @@ static int __devinit snd_ad1816a_pnp_detect(struct pnp_card_link *card,
275 if (res < 0) 277 if (res < 0)
276 return res; 278 return res;
277 dev++; 279 dev++;
280 ad1816a_devices++;
278 return 0; 281 return 0;
279 } 282 }
280 return -ENODEV; 283 return -ENODEV;
@@ -297,10 +300,13 @@ static struct pnp_card_driver ad1816a_pnpc_driver = {
297 300
298static int __init alsa_card_ad1816a_init(void) 301static int __init alsa_card_ad1816a_init(void)
299{ 302{
300 int cards; 303 int err;
304
305 err = pnp_register_card_driver(&ad1816a_pnpc_driver);
306 if (err)
307 return err;
301 308
302 cards = pnp_register_card_driver(&ad1816a_pnpc_driver); 309 if (!ad1816a_devices) {
303 if (cards <= 0) {
304 pnp_unregister_card_driver(&ad1816a_pnpc_driver); 310 pnp_unregister_card_driver(&ad1816a_pnpc_driver);
305#ifdef MODULE 311#ifdef MODULE
306 printk(KERN_ERR "no AD1816A based soundcards found.\n"); 312 printk(KERN_ERR "no AD1816A based soundcards found.\n");
diff --git a/sound/isa/als100.c b/sound/isa/als100.c
index 9b77c17b3f66..a52bd8a14c9b 100644
--- a/sound/isa/als100.c
+++ b/sound/isa/als100.c
@@ -199,7 +199,7 @@ static int __devinit snd_card_als100_pnp(int dev, struct snd_card_als100 *acard,
199 return 0; 199 return 0;
200} 200}
201 201
202static int __init snd_card_als100_probe(int dev, 202static int __devinit snd_card_als100_probe(int dev,
203 struct pnp_card_link *pcard, 203 struct pnp_card_link *pcard,
204 const struct pnp_card_device_id *pid) 204 const struct pnp_card_device_id *pid)
205{ 205{
@@ -281,6 +281,8 @@ static int __init snd_card_als100_probe(int dev,
281 return 0; 281 return 0;
282} 282}
283 283
284static unsigned int __devinitdata als100_devices;
285
284static int __devinit snd_als100_pnp_detect(struct pnp_card_link *card, 286static int __devinit snd_als100_pnp_detect(struct pnp_card_link *card,
285 const struct pnp_card_device_id *id) 287 const struct pnp_card_device_id *id)
286{ 288{
@@ -294,6 +296,7 @@ static int __devinit snd_als100_pnp_detect(struct pnp_card_link *card,
294 if (res < 0) 296 if (res < 0)
295 return res; 297 return res;
296 dev++; 298 dev++;
299 als100_devices++;
297 return 0; 300 return 0;
298 } 301 }
299 return -ENODEV; 302 return -ENODEV;
@@ -345,10 +348,13 @@ static struct pnp_card_driver als100_pnpc_driver = {
345 348
346static int __init alsa_card_als100_init(void) 349static int __init alsa_card_als100_init(void)
347{ 350{
348 int cards; 351 int err;
352
353 err = pnp_register_card_driver(&als100_pnpc_driver);
354 if (err)
355 return err;
349 356
350 cards = pnp_register_card_driver(&als100_pnpc_driver); 357 if (!als100_devices) {
351 if (cards <= 0) {
352 pnp_unregister_card_driver(&als100_pnpc_driver); 358 pnp_unregister_card_driver(&als100_pnpc_driver);
353#ifdef MODULE 359#ifdef MODULE
354 snd_printk(KERN_ERR "no ALS100 based soundcards found\n"); 360 snd_printk(KERN_ERR "no ALS100 based soundcards found\n");
diff --git a/sound/isa/azt2320.c b/sound/isa/azt2320.c
index a530691bf4f7..15e59283aac6 100644
--- a/sound/isa/azt2320.c
+++ b/sound/isa/azt2320.c
@@ -310,6 +310,8 @@ static int __devinit snd_card_azt2320_probe(int dev,
310 return 0; 310 return 0;
311} 311}
312 312
313static unsigned int __devinitdata azt2320_devices;
314
313static int __devinit snd_azt2320_pnp_detect(struct pnp_card_link *card, 315static int __devinit snd_azt2320_pnp_detect(struct pnp_card_link *card,
314 const struct pnp_card_device_id *id) 316 const struct pnp_card_device_id *id)
315{ 317{
@@ -323,6 +325,7 @@ static int __devinit snd_azt2320_pnp_detect(struct pnp_card_link *card,
323 if (res < 0) 325 if (res < 0)
324 return res; 326 return res;
325 dev++; 327 dev++;
328 azt2320_devices++;
326 return 0; 329 return 0;
327 } 330 }
328 return -ENODEV; 331 return -ENODEV;
@@ -372,10 +375,13 @@ static struct pnp_card_driver azt2320_pnpc_driver = {
372 375
373static int __init alsa_card_azt2320_init(void) 376static int __init alsa_card_azt2320_init(void)
374{ 377{
375 int cards; 378 int err;
379
380 err = pnp_register_card_driver(&azt2320_pnpc_driver);
381 if (err)
382 return err;
376 383
377 cards = pnp_register_card_driver(&azt2320_pnpc_driver); 384 if (!azt2320_devices) {
378 if (cards <= 0) {
379 pnp_unregister_card_driver(&azt2320_pnpc_driver); 385 pnp_unregister_card_driver(&azt2320_pnpc_driver);
380#ifdef MODULE 386#ifdef MODULE
381 snd_printk(KERN_ERR "no AZT2320 based soundcards found\n"); 387 snd_printk(KERN_ERR "no AZT2320 based soundcards found\n");
diff --git a/sound/isa/cmi8330.c b/sound/isa/cmi8330.c
index fd9bb2575de8..fa63048a8b9d 100644
--- a/sound/isa/cmi8330.c
+++ b/sound/isa/cmi8330.c
@@ -175,7 +175,7 @@ MODULE_DEVICE_TABLE(pnp_card, snd_cmi8330_pnpids);
175#endif 175#endif
176 176
177 177
178static struct ad1848_mix_elem snd_cmi8330_controls[] __initdata = { 178static struct ad1848_mix_elem snd_cmi8330_controls[] __devinitdata = {
179AD1848_DOUBLE("Master Playback Volume", 0, CMI8330_MASTVOL, CMI8330_MASTVOL, 4, 0, 15, 0), 179AD1848_DOUBLE("Master Playback Volume", 0, CMI8330_MASTVOL, CMI8330_MASTVOL, 4, 0, 15, 0),
180AD1848_SINGLE("Loud Playback Switch", 0, CMI8330_MUTEMUX, 6, 1, 1), 180AD1848_SINGLE("Loud Playback Switch", 0, CMI8330_MUTEMUX, 6, 1, 1),
181AD1848_DOUBLE("PCM Playback Switch", 0, AD1848_LEFT_OUTPUT, AD1848_RIGHT_OUTPUT, 7, 7, 1, 1), 181AD1848_DOUBLE("PCM Playback Switch", 0, AD1848_LEFT_OUTPUT, AD1848_RIGHT_OUTPUT, 7, 7, 1, 1),
@@ -204,7 +204,7 @@ AD1848_SINGLE(SNDRV_CTL_NAME_IEC958("Input ",PLAYBACK,SWITCH), 0, CMI8330_MUTEMU
204}; 204};
205 205
206#ifdef ENABLE_SB_MIXER 206#ifdef ENABLE_SB_MIXER
207static struct sbmix_elem cmi8330_sb_mixers[] __initdata = { 207static struct sbmix_elem cmi8330_sb_mixers[] __devinitdata = {
208SB_DOUBLE("SB Master Playback Volume", SB_DSP4_MASTER_DEV, (SB_DSP4_MASTER_DEV + 1), 3, 3, 31), 208SB_DOUBLE("SB Master Playback Volume", SB_DSP4_MASTER_DEV, (SB_DSP4_MASTER_DEV + 1), 3, 3, 31),
209SB_DOUBLE("Tone Control - Bass", SB_DSP4_BASS_DEV, (SB_DSP4_BASS_DEV + 1), 4, 4, 15), 209SB_DOUBLE("Tone Control - Bass", SB_DSP4_BASS_DEV, (SB_DSP4_BASS_DEV + 1), 4, 4, 15),
210SB_DOUBLE("Tone Control - Treble", SB_DSP4_TREBLE_DEV, (SB_DSP4_TREBLE_DEV + 1), 4, 4, 15), 210SB_DOUBLE("Tone Control - Treble", SB_DSP4_TREBLE_DEV, (SB_DSP4_TREBLE_DEV + 1), 4, 4, 15),
@@ -222,7 +222,7 @@ SB_DOUBLE("SB Playback Volume", SB_DSP4_OGAIN_DEV, (SB_DSP4_OGAIN_DEV + 1), 6, 6
222SB_SINGLE("SB Mic Auto Gain", SB_DSP4_MIC_AGC, 0, 1), 222SB_SINGLE("SB Mic Auto Gain", SB_DSP4_MIC_AGC, 0, 1),
223}; 223};
224 224
225static unsigned char cmi8330_sb_init_values[][2] __initdata = { 225static unsigned char cmi8330_sb_init_values[][2] __devinitdata = {
226 { SB_DSP4_MASTER_DEV + 0, 0 }, 226 { SB_DSP4_MASTER_DEV + 0, 0 },
227 { SB_DSP4_MASTER_DEV + 1, 0 }, 227 { SB_DSP4_MASTER_DEV + 1, 0 },
228 { SB_DSP4_PCM_DEV + 0, 0 }, 228 { SB_DSP4_PCM_DEV + 0, 0 },
@@ -545,7 +545,7 @@ static int __devinit snd_cmi8330_probe(struct snd_card *card, int dev)
545 return snd_card_register(card); 545 return snd_card_register(card);
546} 546}
547 547
548static int __init snd_cmi8330_nonpnp_probe(struct platform_device *pdev) 548static int __devinit snd_cmi8330_nonpnp_probe(struct platform_device *pdev)
549{ 549{
550 struct snd_card *card; 550 struct snd_card *card;
551 int err; 551 int err;
@@ -607,6 +607,8 @@ static struct platform_driver snd_cmi8330_driver = {
607 607
608 608
609#ifdef CONFIG_PNP 609#ifdef CONFIG_PNP
610static unsigned int __devinitdata cmi8330_pnp_devices;
611
610static int __devinit snd_cmi8330_pnp_detect(struct pnp_card_link *pcard, 612static int __devinit snd_cmi8330_pnp_detect(struct pnp_card_link *pcard,
611 const struct pnp_card_device_id *pid) 613 const struct pnp_card_device_id *pid)
612{ 614{
@@ -636,6 +638,7 @@ static int __devinit snd_cmi8330_pnp_detect(struct pnp_card_link *pcard,
636 } 638 }
637 pnp_set_card_drvdata(pcard, card); 639 pnp_set_card_drvdata(pcard, card);
638 dev++; 640 dev++;
641 cmi8330_pnp_devices++;
639 return 0; 642 return 0;
640} 643}
641 644
@@ -706,9 +709,9 @@ static int __init alsa_card_cmi8330_init(void)
706 709
707#ifdef CONFIG_PNP 710#ifdef CONFIG_PNP
708 err = pnp_register_card_driver(&cmi8330_pnpc_driver); 711 err = pnp_register_card_driver(&cmi8330_pnpc_driver);
709 if (err >= 0) { 712 if (!err) {
710 pnp_registered = 1; 713 pnp_registered = 1;
711 cards += err; 714 cards += cmi8330_pnp_devices;
712 } 715 }
713#endif 716#endif
714 717
diff --git a/sound/isa/cs423x/cs4236.c b/sound/isa/cs423x/cs4236.c
index 4060918e0327..382bb17ef49f 100644
--- a/sound/isa/cs423x/cs4236.c
+++ b/sound/isa/cs423x/cs4236.c
@@ -133,6 +133,7 @@ static int pnpc_registered;
133static int pnp_registered; 133static int pnp_registered;
134#endif 134#endif
135#endif /* CONFIG_PNP */ 135#endif /* CONFIG_PNP */
136static unsigned int snd_cs423x_devices;
136 137
137struct snd_card_cs4236 { 138struct snd_card_cs4236 {
138 struct snd_cs4231 *chip; 139 struct snd_cs4231 *chip;
@@ -564,7 +565,7 @@ static int __init snd_cs423x_nonpnp_probe(struct platform_device *pdev)
564 snd_card_free(card); 565 snd_card_free(card);
565 return err; 566 return err;
566 } 567 }
567 568
568 platform_set_drvdata(pdev, card); 569 platform_set_drvdata(pdev, card);
569 return 0; 570 return 0;
570} 571}
@@ -650,6 +651,7 @@ static int __devinit snd_cs4232_pnpbios_detect(struct pnp_dev *pdev,
650 } 651 }
651 pnp_set_drvdata(pdev, card); 652 pnp_set_drvdata(pdev, card);
652 dev++; 653 dev++;
654 snd_cs423x_devices++;
653 return 0; 655 return 0;
654} 656}
655 657
@@ -713,6 +715,7 @@ static int __devinit snd_cs423x_pnpc_detect(struct pnp_card_link *pcard,
713 } 715 }
714 pnp_set_card_drvdata(pcard, card); 716 pnp_set_card_drvdata(pcard, card);
715 dev++; 717 dev++;
718 snd_cs423x_devices++;
716 return 0; 719 return 0;
717} 720}
718 721
@@ -721,7 +724,7 @@ static void __devexit snd_cs423x_pnpc_remove(struct pnp_card_link * pcard)
721 snd_card_free(pnp_get_card_drvdata(pcard)); 724 snd_card_free(pnp_get_card_drvdata(pcard));
722 pnp_set_card_drvdata(pcard, NULL); 725 pnp_set_card_drvdata(pcard, NULL);
723} 726}
724 727
725#ifdef CONFIG_PM 728#ifdef CONFIG_PM
726static int snd_cs423x_pnpc_suspend(struct pnp_card_link *pcard, pm_message_t state) 729static int snd_cs423x_pnpc_suspend(struct pnp_card_link *pcard, pm_message_t state)
727{ 730{
@@ -766,7 +769,7 @@ static void __init_or_module snd_cs423x_unregister_all(void)
766 769
767static int __init alsa_card_cs423x_init(void) 770static int __init alsa_card_cs423x_init(void)
768{ 771{
769 int i, err, cards = 0; 772 int i, err;
770 773
771 if ((err = platform_driver_register(&cs423x_nonpnp_driver)) < 0) 774 if ((err = platform_driver_register(&cs423x_nonpnp_driver)) < 0)
772 return err; 775 return err;
@@ -782,24 +785,20 @@ static int __init alsa_card_cs423x_init(void)
782 goto errout; 785 goto errout;
783 } 786 }
784 platform_devices[i] = device; 787 platform_devices[i] = device;
785 cards++; 788 snd_cs423x_devices++;
786 } 789 }
787#ifdef CONFIG_PNP 790#ifdef CONFIG_PNP
788#ifdef CS4232 791#ifdef CS4232
789 i = pnp_register_driver(&cs4232_pnp_driver); 792 err = pnp_register_driver(&cs4232_pnp_driver);
790 if (i >= 0) { 793 if (!err)
791 pnp_registered = 1; 794 pnp_registered = 1;
792 cards += i;
793 }
794#endif 795#endif
795 i = pnp_register_card_driver(&cs423x_pnpc_driver); 796 err = pnp_register_card_driver(&cs423x_pnpc_driver);
796 if (i >= 0) { 797 if (!err)
797 pnpc_registered = 1; 798 pnpc_registered = 1;
798 cards += i;
799 }
800#endif /* CONFIG_PNP */ 799#endif /* CONFIG_PNP */
801 800
802 if (!cards) { 801 if (!snd_cs423x_devices) {
803#ifdef MODULE 802#ifdef MODULE
804 printk(KERN_ERR IDENT " soundcard not found or device busy\n"); 803 printk(KERN_ERR IDENT " soundcard not found or device busy\n");
805#endif 804#endif
diff --git a/sound/isa/dt019x.c b/sound/isa/dt019x.c
index 50e7bc5ef561..0acb4e5da47f 100644
--- a/sound/isa/dt019x.c
+++ b/sound/isa/dt019x.c
@@ -272,6 +272,8 @@ static int __devinit snd_card_dt019x_probe(int dev, struct pnp_card_link *pcard,
272 return 0; 272 return 0;
273} 273}
274 274
275static unsigned int __devinitdata dt019x_devices;
276
275static int __devinit snd_dt019x_pnp_probe(struct pnp_card_link *card, 277static int __devinit snd_dt019x_pnp_probe(struct pnp_card_link *card,
276 const struct pnp_card_device_id *pid) 278 const struct pnp_card_device_id *pid)
277{ 279{
@@ -285,6 +287,7 @@ static int __devinit snd_dt019x_pnp_probe(struct pnp_card_link *card,
285 if (res < 0) 287 if (res < 0)
286 return res; 288 return res;
287 dev++; 289 dev++;
290 dt019x_devices++;
288 return 0; 291 return 0;
289 } 292 }
290 return -ENODEV; 293 return -ENODEV;
@@ -336,10 +339,13 @@ static struct pnp_card_driver dt019x_pnpc_driver = {
336 339
337static int __init alsa_card_dt019x_init(void) 340static int __init alsa_card_dt019x_init(void)
338{ 341{
339 int cards = 0; 342 int err;
343
344 err = pnp_register_card_driver(&dt019x_pnpc_driver);
345 if (err)
346 return err;
340 347
341 cards = pnp_register_card_driver(&dt019x_pnpc_driver); 348 if (!dt019x_devices) {
342 if (cards <= 0) {
343 pnp_unregister_card_driver(&dt019x_pnpc_driver); 349 pnp_unregister_card_driver(&dt019x_pnpc_driver);
344#ifdef MODULE 350#ifdef MODULE
345 snd_printk(KERN_ERR "no DT-019X / ALS-007 based soundcards found\n"); 351 snd_printk(KERN_ERR "no DT-019X / ALS-007 based soundcards found\n");
diff --git a/sound/isa/es18xx.c b/sound/isa/es18xx.c
index 721955d26194..9fbc185b4cc2 100644
--- a/sound/isa/es18xx.c
+++ b/sound/isa/es18xx.c
@@ -2204,7 +2204,7 @@ static int __devinit snd_audiodrive_probe(struct snd_card *card, int dev)
2204 return snd_card_register(card); 2204 return snd_card_register(card);
2205} 2205}
2206 2206
2207static int __init snd_es18xx_nonpnp_probe1(int dev, struct platform_device *devptr) 2207static int __devinit snd_es18xx_nonpnp_probe1(int dev, struct platform_device *devptr)
2208{ 2208{
2209 struct snd_card *card; 2209 struct snd_card *card;
2210 int err; 2210 int err;
@@ -2221,7 +2221,7 @@ static int __init snd_es18xx_nonpnp_probe1(int dev, struct platform_device *devp
2221 return 0; 2221 return 0;
2222} 2222}
2223 2223
2224static int __init snd_es18xx_nonpnp_probe(struct platform_device *pdev) 2224static int __devinit snd_es18xx_nonpnp_probe(struct platform_device *pdev)
2225{ 2225{
2226 int dev = pdev->id; 2226 int dev = pdev->id;
2227 int err; 2227 int err;
@@ -2297,6 +2297,8 @@ static struct platform_driver snd_es18xx_nonpnp_driver = {
2297 2297
2298 2298
2299#ifdef CONFIG_PNP 2299#ifdef CONFIG_PNP
2300static unsigned int __devinitdata es18xx_pnp_devices;
2301
2300static int __devinit snd_audiodrive_pnp_detect(struct pnp_card_link *pcard, 2302static int __devinit snd_audiodrive_pnp_detect(struct pnp_card_link *pcard,
2301 const struct pnp_card_device_id *pid) 2303 const struct pnp_card_device_id *pid)
2302{ 2304{
@@ -2327,6 +2329,7 @@ static int __devinit snd_audiodrive_pnp_detect(struct pnp_card_link *pcard,
2327 2329
2328 pnp_set_card_drvdata(pcard, card); 2330 pnp_set_card_drvdata(pcard, card);
2329 dev++; 2331 dev++;
2332 es18xx_pnp_devices++;
2330 return 0; 2333 return 0;
2331} 2334}
2332 2335
@@ -2397,10 +2400,10 @@ static int __init alsa_card_es18xx_init(void)
2397 } 2400 }
2398 2401
2399#ifdef CONFIG_PNP 2402#ifdef CONFIG_PNP
2400 i = pnp_register_card_driver(&es18xx_pnpc_driver); 2403 err = pnp_register_card_driver(&es18xx_pnpc_driver);
2401 if (i >= 0) { 2404 if (!err) {
2402 pnp_registered = 1; 2405 pnp_registered = 1;
2403 cards += i; 2406 cards += es18xx_pnp_devices;
2404 } 2407 }
2405#endif 2408#endif
2406 2409
diff --git a/sound/isa/gus/interwave.c b/sound/isa/gus/interwave.c
index 2cacd0fa6871..de71b7a99c83 100644
--- a/sound/isa/gus/interwave.c
+++ b/sound/isa/gus/interwave.c
@@ -791,7 +791,7 @@ static int __devinit snd_interwave_probe(struct snd_card *card, int dev)
791 return 0; 791 return 0;
792} 792}
793 793
794static int __init snd_interwave_nonpnp_probe1(int dev, struct platform_device *devptr) 794static int __devinit snd_interwave_nonpnp_probe1(int dev, struct platform_device *devptr)
795{ 795{
796 struct snd_card *card; 796 struct snd_card *card;
797 int err; 797 int err;
@@ -809,7 +809,7 @@ static int __init snd_interwave_nonpnp_probe1(int dev, struct platform_device *d
809 return 0; 809 return 0;
810} 810}
811 811
812static int __init snd_interwave_nonpnp_probe(struct platform_device *pdev) 812static int __devinit snd_interwave_nonpnp_probe(struct platform_device *pdev)
813{ 813{
814 int dev = pdev->id; 814 int dev = pdev->id;
815 int err; 815 int err;
@@ -867,6 +867,7 @@ static struct platform_driver snd_interwave_driver = {
867}; 867};
868 868
869#ifdef CONFIG_PNP 869#ifdef CONFIG_PNP
870static unsigned int __devinitdata interwave_pnp_devices;
870 871
871static int __devinit snd_interwave_pnp_detect(struct pnp_card_link *pcard, 872static int __devinit snd_interwave_pnp_detect(struct pnp_card_link *pcard,
872 const struct pnp_card_device_id *pid) 873 const struct pnp_card_device_id *pid)
@@ -897,6 +898,7 @@ static int __devinit snd_interwave_pnp_detect(struct pnp_card_link *pcard,
897 } 898 }
898 pnp_set_card_drvdata(pcard, card); 899 pnp_set_card_drvdata(pcard, card);
899 dev++; 900 dev++;
901 interwave_pnp_devices++;
900 return 0; 902 return 0;
901} 903}
902 904
@@ -954,10 +956,10 @@ static int __init alsa_card_interwave_init(void)
954 } 956 }
955 957
956 /* ISA PnP cards */ 958 /* ISA PnP cards */
957 i = pnp_register_card_driver(&interwave_pnpc_driver); 959 err = pnp_register_card_driver(&interwave_pnpc_driver);
958 if (i >= 0) { 960 if (!err) {
959 pnp_registered = 1; 961 pnp_registered = 1;
960 cards += i; 962 cards += interwave_pnp_devices;;
961 } 963 }
962 964
963 if (!cards) { 965 if (!cards) {
diff --git a/sound/isa/opl3sa2.c b/sound/isa/opl3sa2.c
index 56fcd8a946a4..c906e205d7d5 100644
--- a/sound/isa/opl3sa2.c
+++ b/sound/isa/opl3sa2.c
@@ -95,6 +95,7 @@ static struct platform_device *platform_devices[SNDRV_CARDS];
95static int pnp_registered; 95static int pnp_registered;
96static int pnpc_registered; 96static int pnpc_registered;
97#endif 97#endif
98static unsigned int snd_opl3sa2_devices;
98 99
99/* control ports */ 100/* control ports */
100#define OPL3SA2_PM_CTRL 0x01 101#define OPL3SA2_PM_CTRL 0x01
@@ -760,6 +761,7 @@ static int __devinit snd_opl3sa2_pnp_detect(struct pnp_dev *pdev,
760 } 761 }
761 pnp_set_drvdata(pdev, card); 762 pnp_set_drvdata(pdev, card);
762 dev++; 763 dev++;
764 snd_opl3sa2_devices++;
763 return 0; 765 return 0;
764} 766}
765 767
@@ -826,6 +828,7 @@ static int __devinit snd_opl3sa2_pnp_cdetect(struct pnp_card_link *pcard,
826 } 828 }
827 pnp_set_card_drvdata(pcard, card); 829 pnp_set_card_drvdata(pcard, card);
828 dev++; 830 dev++;
831 snd_opl3sa2_devices++;
829 return 0; 832 return 0;
830} 833}
831 834
@@ -944,7 +947,7 @@ static void __init_or_module snd_opl3sa2_unregister_all(void)
944 947
945static int __init alsa_card_opl3sa2_init(void) 948static int __init alsa_card_opl3sa2_init(void)
946{ 949{
947 int i, err, cards = 0; 950 int i, err;
948 951
949 if ((err = platform_driver_register(&snd_opl3sa2_nonpnp_driver)) < 0) 952 if ((err = platform_driver_register(&snd_opl3sa2_nonpnp_driver)) < 0)
950 return err; 953 return err;
@@ -964,23 +967,19 @@ static int __init alsa_card_opl3sa2_init(void)
964 goto errout; 967 goto errout;
965 } 968 }
966 platform_devices[i] = device; 969 platform_devices[i] = device;
967 cards++; 970 snd_opl3sa2_devices++;
968 } 971 }
969 972
970#ifdef CONFIG_PNP 973#ifdef CONFIG_PNP
971 err = pnp_register_driver(&opl3sa2_pnp_driver); 974 err = pnp_register_driver(&opl3sa2_pnp_driver);
972 if (err >= 0) { 975 if (!err)
973 pnp_registered = 1; 976 pnp_registered = 1;
974 cards += err;
975 }
976 err = pnp_register_card_driver(&opl3sa2_pnpc_driver); 977 err = pnp_register_card_driver(&opl3sa2_pnpc_driver);
977 if (err >= 0) { 978 if (!err)
978 pnpc_registered = 1; 979 pnpc_registered = 1;
979 cards += err;
980 }
981#endif 980#endif
982 981
983 if (!cards) { 982 if (!snd_opl3sa2_devices) {
984#ifdef MODULE 983#ifdef MODULE
985 snd_printk(KERN_ERR "Yamaha OPL3-SA soundcard not found or device busy\n"); 984 snd_printk(KERN_ERR "Yamaha OPL3-SA soundcard not found or device busy\n");
986#endif 985#endif
diff --git a/sound/isa/sb/es968.c b/sound/isa/sb/es968.c
index 9da80bfa3027..d4d65b84265a 100644
--- a/sound/isa/sb/es968.c
+++ b/sound/isa/sb/es968.c
@@ -124,7 +124,7 @@ static int __devinit snd_card_es968_pnp(int dev, struct snd_card_es968 *acard,
124 return 0; 124 return 0;
125} 125}
126 126
127static int __init snd_card_es968_probe(int dev, 127static int __devinit snd_card_es968_probe(int dev,
128 struct pnp_card_link *pcard, 128 struct pnp_card_link *pcard,
129 const struct pnp_card_device_id *pid) 129 const struct pnp_card_device_id *pid)
130{ 130{
@@ -182,6 +182,8 @@ static int __init snd_card_es968_probe(int dev,
182 return 0; 182 return 0;
183} 183}
184 184
185static unsigned int __devinitdata es968_devices;
186
185static int __devinit snd_es968_pnp_detect(struct pnp_card_link *card, 187static int __devinit snd_es968_pnp_detect(struct pnp_card_link *card,
186 const struct pnp_card_device_id *id) 188 const struct pnp_card_device_id *id)
187{ 189{
@@ -195,6 +197,7 @@ static int __devinit snd_es968_pnp_detect(struct pnp_card_link *card,
195 if (res < 0) 197 if (res < 0)
196 return res; 198 return res;
197 dev++; 199 dev++;
200 es968_devices++;
198 return 0; 201 return 0;
199 } 202 }
200 return -ENODEV; 203 return -ENODEV;
@@ -246,8 +249,11 @@ static struct pnp_card_driver es968_pnpc_driver = {
246 249
247static int __init alsa_card_es968_init(void) 250static int __init alsa_card_es968_init(void)
248{ 251{
249 int cards = pnp_register_card_driver(&es968_pnpc_driver); 252 int err = pnp_register_card_driver(&es968_pnpc_driver);
250 if (cards <= 0) { 253 if (err)
254 return err;
255
256 if (!es968_devices) {
251 pnp_unregister_card_driver(&es968_pnpc_driver); 257 pnp_unregister_card_driver(&es968_pnpc_driver);
252#ifdef MODULE 258#ifdef MODULE
253 snd_printk(KERN_ERR "no ES968 based soundcards found\n"); 259 snd_printk(KERN_ERR "no ES968 based soundcards found\n");
diff --git a/sound/isa/sb/sb16.c b/sound/isa/sb/sb16.c
index 5737ab76160c..21ea65925a9e 100644
--- a/sound/isa/sb/sb16.c
+++ b/sound/isa/sb/sb16.c
@@ -369,7 +369,7 @@ static struct snd_card *snd_sb16_card_new(int dev)
369 return card; 369 return card;
370} 370}
371 371
372static int __init snd_sb16_probe(struct snd_card *card, int dev) 372static int __devinit snd_sb16_probe(struct snd_card *card, int dev)
373{ 373{
374 int xirq, xdma8, xdma16; 374 int xirq, xdma8, xdma16;
375 struct snd_sb *chip; 375 struct snd_sb *chip;
@@ -518,7 +518,7 @@ static int snd_sb16_resume(struct snd_card *card)
518} 518}
519#endif 519#endif
520 520
521static int __init snd_sb16_nonpnp_probe1(int dev, struct platform_device *devptr) 521static int __devinit snd_sb16_nonpnp_probe1(int dev, struct platform_device *devptr)
522{ 522{
523 struct snd_card_sb16 *acard; 523 struct snd_card_sb16 *acard;
524 struct snd_card *card; 524 struct snd_card *card;
@@ -548,7 +548,7 @@ static int __init snd_sb16_nonpnp_probe1(int dev, struct platform_device *devptr
548} 548}
549 549
550 550
551static int __init snd_sb16_nonpnp_probe(struct platform_device *pdev) 551static int __devinit snd_sb16_nonpnp_probe(struct platform_device *pdev)
552{ 552{
553 int dev = pdev->id; 553 int dev = pdev->id;
554 int err; 554 int err;
@@ -629,6 +629,7 @@ static struct platform_driver snd_sb16_nonpnp_driver = {
629 629
630 630
631#ifdef CONFIG_PNP 631#ifdef CONFIG_PNP
632static unsigned int __devinitdata sb16_pnp_devices;
632 633
633static int __devinit snd_sb16_pnp_detect(struct pnp_card_link *pcard, 634static int __devinit snd_sb16_pnp_detect(struct pnp_card_link *pcard,
634 const struct pnp_card_device_id *pid) 635 const struct pnp_card_device_id *pid)
@@ -651,6 +652,7 @@ static int __devinit snd_sb16_pnp_detect(struct pnp_card_link *pcard,
651 } 652 }
652 pnp_set_card_drvdata(pcard, card); 653 pnp_set_card_drvdata(pcard, card);
653 dev++; 654 dev++;
655 sb16_pnp_devices++;
654 return 0; 656 return 0;
655 } 657 }
656 658
@@ -727,10 +729,10 @@ static int __init alsa_card_sb16_init(void)
727 } 729 }
728#ifdef CONFIG_PNP 730#ifdef CONFIG_PNP
729 /* PnP cards at last */ 731 /* PnP cards at last */
730 i = pnp_register_card_driver(&sb16_pnpc_driver); 732 err = pnp_register_card_driver(&sb16_pnpc_driver);
731 if (i >= 0) { 733 if (!err) {
732 pnp_registered = 1; 734 pnp_registered = 1;
733 cards += i; 735 cards += sb16_pnp_devices;
734 } 736 }
735#endif 737#endif
736 738
diff --git a/sound/isa/sscape.c b/sound/isa/sscape.c
index 29bba8cc3ef3..48e5552d3444 100644
--- a/sound/isa/sscape.c
+++ b/sound/isa/sscape.c
@@ -1255,7 +1255,7 @@ static int __devinit create_sscape(int dev, struct snd_card **rcardp)
1255} 1255}
1256 1256
1257 1257
1258static int __init snd_sscape_probe(struct platform_device *pdev) 1258static int __devinit snd_sscape_probe(struct platform_device *pdev)
1259{ 1259{
1260 int dev = pdev->id; 1260 int dev = pdev->id;
1261 struct snd_card *card; 1261 struct snd_card *card;
@@ -1469,7 +1469,7 @@ static int __init sscape_init(void)
1469 if (ret < 0) 1469 if (ret < 0)
1470 return ret; 1470 return ret;
1471#ifdef CONFIG_PNP 1471#ifdef CONFIG_PNP
1472 if (pnp_register_card_driver(&sscape_pnpc_driver) >= 0) 1472 if (pnp_register_card_driver(&sscape_pnpc_driver) == 0)
1473 pnp_registered = 1; 1473 pnp_registered = 1;
1474#endif 1474#endif
1475 return 0; 1475 return 0;
diff --git a/sound/isa/wavefront/wavefront.c b/sound/isa/wavefront/wavefront.c
index c0115bf9065e..2f13cd5d4dcb 100644
--- a/sound/isa/wavefront/wavefront.c
+++ b/sound/isa/wavefront/wavefront.c
@@ -589,7 +589,7 @@ snd_wavefront_probe (struct snd_card *card, int dev)
589 return snd_card_register(card); 589 return snd_card_register(card);
590} 590}
591 591
592static int __init snd_wavefront_nonpnp_probe(struct platform_device *pdev) 592static int __devinit snd_wavefront_nonpnp_probe(struct platform_device *pdev)
593{ 593{
594 int dev = pdev->id; 594 int dev = pdev->id;
595 struct snd_card *card; 595 struct snd_card *card;
@@ -637,6 +637,7 @@ static struct platform_driver snd_wavefront_driver = {
637 637
638 638
639#ifdef CONFIG_PNP 639#ifdef CONFIG_PNP
640static unsigned int __devinitdata wavefront_pnp_devices;
640 641
641static int __devinit snd_wavefront_pnp_detect(struct pnp_card_link *pcard, 642static int __devinit snd_wavefront_pnp_detect(struct pnp_card_link *pcard,
642 const struct pnp_card_device_id *pid) 643 const struct pnp_card_device_id *pid)
@@ -670,6 +671,7 @@ static int __devinit snd_wavefront_pnp_detect(struct pnp_card_link *pcard,
670 671
671 pnp_set_card_drvdata(pcard, card); 672 pnp_set_card_drvdata(pcard, card);
672 dev++; 673 dev++;
674 wavefront_pnp_devices++;
673 return 0; 675 return 0;
674} 676}
675 677
@@ -729,10 +731,10 @@ static int __init alsa_card_wavefront_init(void)
729 } 731 }
730 732
731#ifdef CONFIG_PNP 733#ifdef CONFIG_PNP
732 i = pnp_register_card_driver(&wavefront_pnpc_driver); 734 err = pnp_register_card_driver(&wavefront_pnpc_driver);
733 if (i >= 0) { 735 if (!err) {
734 pnp_registered = 1; 736 pnp_registered = 1;
735 cards += i; 737 cards += wavefront_pnp_devices;
736 } 738 }
737#endif 739#endif
738 740