From 16dab54b8cbac39bd3f639db5d7d0fd8300a6cb0 Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Mon, 5 Sep 2005 17:17:58 +0200 Subject: [ALSA] Add snd_card_set_generic_dev() call ARM,SA11xx UDA1341 driver,Generic drivers,MPU401 UART,MIPS MIPS AU1x00 driver,PPC,PPC PowerMac driver,SPARC,SPARC AMD7930 driver SPARC cs4231 driver,SPARC DBRI driver - Added snd_card_set_generic_dev() call. - Added SND_GENERIC_DRIVER to Kconfig. - Clean up the error path in probe if necessary. Signed-off-by: Takashi Iwai --- sound/drivers/mpu401/mpu401.c | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) (limited to 'sound/drivers/mpu401') diff --git a/sound/drivers/mpu401/mpu401.c b/sound/drivers/mpu401/mpu401.c index cb36ecb7869..54e2ff9b5ca 100644 --- a/sound/drivers/mpu401/mpu401.c +++ b/sound/drivers/mpu401/mpu401.c @@ -77,20 +77,26 @@ static int snd_mpu401_create(int dev, snd_card_t **rcard) strcat(card->longname, "polled"); } - if (snd_mpu401_uart_new(card, 0, - MPU401_HW_MPU401, - port[dev], 0, - irq[dev], irq[dev] >= 0 ? SA_INTERRUPT : 0, NULL) < 0) { + if ((err = snd_mpu401_uart_new(card, 0, + MPU401_HW_MPU401, + port[dev], 0, + irq[dev], irq[dev] >= 0 ? SA_INTERRUPT : 0, NULL)) < 0) { printk(KERN_ERR "MPU401 not detected at 0x%lx\n", port[dev]); - snd_card_free(card); - return -ENODEV; - } - if ((err = snd_card_register(card)) < 0) { - snd_card_free(card); - return err; + goto _err; } + + if ((err = snd_card_set_generic_dev(card)) < 0) + goto _err; + + if ((err = snd_card_register(card)) < 0) + goto _err; + *rcard = card; return 0; + + _err: + snd_card_free(card); + return err; } static int __devinit snd_mpu401_probe(int dev) -- cgit v1.2.3