aboutsummaryrefslogtreecommitdiffstats
path: root/sound/isa/cs423x/cs4231.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/isa/cs423x/cs4231.c')
-rw-r--r--sound/isa/cs423x/cs4231.c46
1 files changed, 22 insertions, 24 deletions
diff --git a/sound/isa/cs423x/cs4231.c b/sound/isa/cs423x/cs4231.c
index 7640837659ea..9be5416bcb92 100644
--- a/sound/isa/cs423x/cs4231.c
+++ b/sound/isa/cs423x/cs4231.c
@@ -76,15 +76,15 @@ static int __init snd_card_cs4231_probe(int dev)
76 int err; 76 int err;
77 77
78 if (port[dev] == SNDRV_AUTO_PORT) { 78 if (port[dev] == SNDRV_AUTO_PORT) {
79 snd_printk("specify port\n"); 79 snd_printk(KERN_ERR "specify port\n");
80 return -EINVAL; 80 return -EINVAL;
81 } 81 }
82 if (irq[dev] == SNDRV_AUTO_IRQ) { 82 if (irq[dev] == SNDRV_AUTO_IRQ) {
83 snd_printk("specify irq\n"); 83 snd_printk(KERN_ERR "specify irq\n");
84 return -EINVAL; 84 return -EINVAL;
85 } 85 }
86 if (dma1[dev] == SNDRV_AUTO_DMA) { 86 if (dma1[dev] == SNDRV_AUTO_DMA) {
87 snd_printk("specify dma1\n"); 87 snd_printk(KERN_ERR "specify dma1\n");
88 return -EINVAL; 88 return -EINVAL;
89 } 89 }
90 card = snd_card_new(index[dev], id[dev], THIS_MODULE, 0); 90 card = snd_card_new(index[dev], id[dev], THIS_MODULE, 0);
@@ -96,15 +96,11 @@ static int __init snd_card_cs4231_probe(int dev)
96 dma1[dev], 96 dma1[dev],
97 dma2[dev], 97 dma2[dev],
98 CS4231_HW_DETECT, 98 CS4231_HW_DETECT,
99 0, &chip)) < 0) { 99 0, &chip)) < 0)
100 snd_card_free(card); 100 goto _err;
101 return err;
102 }
103 101
104 if ((err = snd_cs4231_pcm(chip, 0, &pcm)) < 0) { 102 if ((err = snd_cs4231_pcm(chip, 0, &pcm)) < 0)
105 snd_card_free(card); 103 goto _err;
106 return err;
107 }
108 104
109 strcpy(card->driver, "CS4231"); 105 strcpy(card->driver, "CS4231");
110 strcpy(card->shortname, pcm->name); 106 strcpy(card->shortname, pcm->name);
@@ -113,14 +109,10 @@ static int __init snd_card_cs4231_probe(int dev)
113 if (dma2[dev] >= 0) 109 if (dma2[dev] >= 0)
114 sprintf(card->longname + strlen(card->longname), "&%d", dma2[dev]); 110 sprintf(card->longname + strlen(card->longname), "&%d", dma2[dev]);
115 111
116 if ((err = snd_cs4231_mixer(chip)) < 0) { 112 if ((err = snd_cs4231_mixer(chip)) < 0)
117 snd_card_free(card); 113 goto _err;
118 return err; 114 if ((err = snd_cs4231_timer(chip, 0, NULL)) < 0)
119 } 115 goto _err;
120 if ((err = snd_cs4231_timer(chip, 0, NULL)) < 0) {
121 snd_card_free(card);
122 return err;
123 }
124 116
125 if (mpu_port[dev] > 0 && mpu_port[dev] != SNDRV_AUTO_PORT) { 117 if (mpu_port[dev] > 0 && mpu_port[dev] != SNDRV_AUTO_PORT) {
126 if (mpu_irq[dev] == SNDRV_AUTO_IRQ) 118 if (mpu_irq[dev] == SNDRV_AUTO_IRQ)
@@ -130,14 +122,20 @@ static int __init snd_card_cs4231_probe(int dev)
130 mpu_irq[dev], 122 mpu_irq[dev],
131 mpu_irq[dev] >= 0 ? SA_INTERRUPT : 0, 123 mpu_irq[dev] >= 0 ? SA_INTERRUPT : 0,
132 NULL) < 0) 124 NULL) < 0)
133 printk(KERN_ERR "cs4231: MPU401 not detected\n"); 125 printk(KERN_WARNING "cs4231: MPU401 not detected\n");
134 }
135 if ((err = snd_card_register(card)) < 0) {
136 snd_card_free(card);
137 return err;
138 } 126 }
127
128 if ((err = snd_card_set_generic_dev(card)) < 0)
129 goto _err;
130
131 if ((err = snd_card_register(card)) < 0)
132 goto _err;
139 snd_cs4231_cards[dev] = card; 133 snd_cs4231_cards[dev] = card;
140 return 0; 134 return 0;
135
136 _err:
137 snd_card_free(card);
138 return err;
141} 139}
142 140
143static int __init alsa_card_cs4231_init(void) 141static int __init alsa_card_cs4231_init(void)