diff options
Diffstat (limited to 'sound/isa/cs423x/cs4231.c')
-rw-r--r-- | sound/isa/cs423x/cs4231.c | 21 |
1 files changed, 6 insertions, 15 deletions
diff --git a/sound/isa/cs423x/cs4231.c b/sound/isa/cs423x/cs4231.c index ec054b929214..1e8923385366 100644 --- a/sound/isa/cs423x/cs4231.c +++ b/sound/isa/cs423x/cs4231.c @@ -79,20 +79,20 @@ static int snd_cs4231_probe(struct device *dev, unsigned int n) struct snd_wss *chip; int error; - error = snd_card_new(dev, index[n], id[n], THIS_MODULE, 0, &card); + error = snd_devm_card_new(dev, index[n], id[n], THIS_MODULE, 0, &card); if (error < 0) return error; error = snd_wss_create(card, port[n], -1, irq[n], dma1[n], dma2[n], WSS_HW_DETECT, 0, &chip); if (error < 0) - goto out; + return error; card->private_data = chip; error = snd_wss_pcm(chip, 0); if (error < 0) - goto out; + return error; strscpy(card->driver, "CS4231", sizeof(card->driver)); strscpy(card->shortname, chip->pcm->name, sizeof(card->shortname)); @@ -108,11 +108,11 @@ static int snd_cs4231_probe(struct device *dev, unsigned int n) error = snd_wss_mixer(chip); if (error < 0) - goto out; + return error; error = snd_wss_timer(chip, 0); if (error < 0) - goto out; + return error; if (mpu_port[n] > 0 && mpu_port[n] != SNDRV_AUTO_PORT) { if (mpu_irq[n] == SNDRV_AUTO_IRQ) @@ -125,18 +125,10 @@ static int snd_cs4231_probe(struct device *dev, unsigned int n) error = snd_card_register(card); if (error < 0) - goto out; + return error; dev_set_drvdata(dev, card); return 0; - -out: snd_card_free(card); - return error; -} - -static void snd_cs4231_remove(struct device *dev, unsigned int n) -{ - snd_card_free(dev_get_drvdata(dev)); } #ifdef CONFIG_PM @@ -164,7 +156,6 @@ static int snd_cs4231_resume(struct device *dev, unsigned int n) static struct isa_driver snd_cs4231_driver = { .match = snd_cs4231_match, .probe = snd_cs4231_probe, - .remove = snd_cs4231_remove, #ifdef CONFIG_PM .suspend = snd_cs4231_suspend, .resume = snd_cs4231_resume, |