aboutsummaryrefslogtreecommitdiffstats
path: root/sound/isa/cs423x/cs4236.c
diff options
context:
space:
mode:
authorKrzysztof Helt <krzysztof.h1@wp.pl>2009-11-05 12:32:41 -0500
committerTakashi Iwai <tiwai@suse.de>2009-11-05 12:10:25 -0500
commitd114cd84a1c5ce42bb10cd3a2da57b2bbcef909b (patch)
tree32c7f37af0cc9ec55a37357723b7c4f055462830 /sound/isa/cs423x/cs4236.c
parent9dcaa7b25f2c8f6a0485854cd3641f585a154072 (diff)
ALSA: cs4236: detect chip in one pass
The cs4236 was two step detection with call to the snd_wss_free() between two steps. The snd_wss_free() did not free a sound device created in the snd_wss_create(). This caused an OOPS during module removal as the same sound device was released twice. The same OOPS happened if the cs4236 module loading failed. Fix this by adapting the snd_cs4236_create() to correctly work with chips less capable then cs4236. The snd_cs4236_create() behaves the same as the snd_wss_create() if the chip is less capable than the cs4236. Signed-off-by: Krzysztof Helt <krzysztof.h1@wp.pl> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/isa/cs423x/cs4236.c')
-rw-r--r--sound/isa/cs423x/cs4236.c13
1 files changed, 3 insertions, 10 deletions
diff --git a/sound/isa/cs423x/cs4236.c b/sound/isa/cs423x/cs4236.c
index a076a6ce8071..93fa6720d197 100644
--- a/sound/isa/cs423x/cs4236.c
+++ b/sound/isa/cs423x/cs4236.c
@@ -394,21 +394,15 @@ static int __devinit snd_cs423x_probe(struct snd_card *card, int dev)
394 return -EBUSY; 394 return -EBUSY;
395 } 395 }
396 396
397 err = snd_wss_create(card, port[dev], cport[dev], 397 err = snd_cs4236_create(card, port[dev], cport[dev],
398 irq[dev], 398 irq[dev],
399 dma1[dev], dma2[dev], 399 dma1[dev], dma2[dev],
400 WSS_HW_DETECT3, 0, &chip); 400 WSS_HW_DETECT3, 0, &chip);
401 if (err < 0) 401 if (err < 0)
402 return err; 402 return err;
403
404 acard->chip = chip;
403 if (chip->hardware & WSS_HW_CS4236B_MASK) { 405 if (chip->hardware & WSS_HW_CS4236B_MASK) {
404 snd_wss_free(chip);
405 err = snd_cs4236_create(card,
406 port[dev], cport[dev],
407 irq[dev], dma1[dev], dma2[dev],
408 WSS_HW_DETECT, 0, &chip);
409 if (err < 0)
410 return err;
411 acard->chip = chip;
412 406
413 err = snd_cs4236_pcm(chip, 0, &pcm); 407 err = snd_cs4236_pcm(chip, 0, &pcm);
414 if (err < 0) 408 if (err < 0)
@@ -418,7 +412,6 @@ static int __devinit snd_cs423x_probe(struct snd_card *card, int dev)
418 if (err < 0) 412 if (err < 0)
419 return err; 413 return err;
420 } else { 414 } else {
421 acard->chip = chip;
422 err = snd_wss_pcm(chip, 0, &pcm); 415 err = snd_wss_pcm(chip, 0, &pcm);
423 if (err < 0) 416 if (err < 0)
424 return err; 417 return err;