aboutsummaryrefslogtreecommitdiffstats
path: root/sound/isa
diff options
context:
space:
mode:
Diffstat (limited to 'sound/isa')
-rw-r--r--sound/isa/opl3sa2.c17
1 files changed, 8 insertions, 9 deletions
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