summaryrefslogtreecommitdiffstats
path: root/sound/drivers/mpu401/mpu401.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2005-09-05 17:17:58 +0200
committerJaroslav Kysela <perex@suse.cz>2005-09-12 10:41:56 +0200
commit16dab54b8cbac39bd3f639db5d7d0fd8300a6cb0 (patch)
treea7e9f4561bb4df38222c2ef5a48d111f52cc5dd3 /sound/drivers/mpu401/mpu401.c
parentecbcfe36fa882e9f8f2be63ac0c42978336bf997 (diff)
downloadop-kernel-dev-16dab54b8cbac39bd3f639db5d7d0fd8300a6cb0.zip
op-kernel-dev-16dab54b8cbac39bd3f639db5d7d0fd8300a6cb0.tar.gz
[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 <tiwai@suse.de>
Diffstat (limited to 'sound/drivers/mpu401/mpu401.c')
-rw-r--r--sound/drivers/mpu401/mpu401.c26
1 files changed, 16 insertions, 10 deletions
diff --git a/sound/drivers/mpu401/mpu401.c b/sound/drivers/mpu401/mpu401.c
index cb36ecb..54e2ff9 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)
OpenPOWER on IntegriCloud