diff options
Diffstat (limited to 'sound/isa/ad1816a/ad1816a.c')
-rw-r--r-- | sound/isa/ad1816a/ad1816a.c | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/sound/isa/ad1816a/ad1816a.c b/sound/isa/ad1816a/ad1816a.c index 77524244a846..bbcbf92a8ebe 100644 --- a/sound/isa/ad1816a/ad1816a.c +++ b/sound/isa/ad1816a/ad1816a.c | |||
@@ -156,10 +156,12 @@ static int __devinit snd_card_ad1816a_probe(int dev, struct pnp_card_link *pcard | |||
156 | struct snd_card_ad1816a *acard; | 156 | struct snd_card_ad1816a *acard; |
157 | struct snd_ad1816a *chip; | 157 | struct snd_ad1816a *chip; |
158 | struct snd_opl3 *opl3; | 158 | struct snd_opl3 *opl3; |
159 | struct snd_timer *timer; | ||
159 | 160 | ||
160 | if ((card = snd_card_new(index[dev], id[dev], THIS_MODULE, | 161 | error = snd_card_create(index[dev], id[dev], THIS_MODULE, |
161 | sizeof(struct snd_card_ad1816a))) == NULL) | 162 | sizeof(struct snd_card_ad1816a), &card); |
162 | return -ENOMEM; | 163 | if (error < 0) |
164 | return error; | ||
163 | acard = (struct snd_card_ad1816a *)card->private_data; | 165 | acard = (struct snd_card_ad1816a *)card->private_data; |
164 | 166 | ||
165 | if ((error = snd_card_ad1816a_pnp(dev, acard, pcard, pid))) { | 167 | if ((error = snd_card_ad1816a_pnp(dev, acard, pcard, pid))) { |
@@ -194,6 +196,12 @@ static int __devinit snd_card_ad1816a_probe(int dev, struct pnp_card_link *pcard | |||
194 | return error; | 196 | return error; |
195 | } | 197 | } |
196 | 198 | ||
199 | error = snd_ad1816a_timer(chip, 0, &timer); | ||
200 | if (error < 0) { | ||
201 | snd_card_free(card); | ||
202 | return error; | ||
203 | } | ||
204 | |||
197 | if (mpu_port[dev] > 0) { | 205 | if (mpu_port[dev] > 0) { |
198 | if (snd_mpu401_uart_new(card, 0, MPU401_HW_MPU401, | 206 | if (snd_mpu401_uart_new(card, 0, MPU401_HW_MPU401, |
199 | mpu_port[dev], 0, mpu_irq[dev], IRQF_DISABLED, | 207 | mpu_port[dev], 0, mpu_irq[dev], IRQF_DISABLED, |
@@ -207,11 +215,8 @@ static int __devinit snd_card_ad1816a_probe(int dev, struct pnp_card_link *pcard | |||
207 | OPL3_HW_AUTO, 0, &opl3) < 0) { | 215 | OPL3_HW_AUTO, 0, &opl3) < 0) { |
208 | printk(KERN_ERR PFX "no OPL device at 0x%lx-0x%lx.\n", fm_port[dev], fm_port[dev] + 2); | 216 | printk(KERN_ERR PFX "no OPL device at 0x%lx-0x%lx.\n", fm_port[dev], fm_port[dev] + 2); |
209 | } else { | 217 | } else { |
210 | if ((error = snd_opl3_timer_new(opl3, 1, 2)) < 0) { | 218 | error = snd_opl3_hwdep_new(opl3, 0, 1, NULL); |
211 | snd_card_free(card); | 219 | if (error < 0) { |
212 | return error; | ||
213 | } | ||
214 | if ((error = snd_opl3_hwdep_new(opl3, 0, 1, NULL)) < 0) { | ||
215 | snd_card_free(card); | 220 | snd_card_free(card); |
216 | return error; | 221 | return error; |
217 | } | 222 | } |