aboutsummaryrefslogtreecommitdiffstats
path: root/sound/isa/cs423x/cs4236.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/isa/cs423x/cs4236.c')
-rw-r--r--sound/isa/cs423x/cs4236.c25
1 files changed, 12 insertions, 13 deletions
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