aboutsummaryrefslogtreecommitdiff
path: root/sound/drivers/serial-u16550.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/serial-u16550.c
parentecbcfe36fa882e9f8f2be63ac0c42978336bf997 (diff)
[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/serial-u16550.c')
-rw-r--r--sound/drivers/serial-u16550.c26
1 files changed, 14 insertions, 12 deletions
diff --git a/sound/drivers/serial-u16550.c b/sound/drivers/serial-u16550.c
index 986df35fb82..fd3bb9dd1d2 100644
--- a/sound/drivers/serial-u16550.c
+++ b/sound/drivers/serial-u16550.c
@@ -928,15 +928,11 @@ static int __init snd_serial_probe(int dev)
base[dev],
adaptor[dev],
droponfull[dev],
- &uart)) < 0) {
- snd_card_free(card);
- return err;
- }
+ &uart)) < 0)
+ goto _err;
- if ((err = snd_uart16550_rmidi(uart, 0, outs[dev], ins[dev], &uart->rmidi)) < 0) {
- snd_card_free(card);
- return err;
- }
+ if ((err = snd_uart16550_rmidi(uart, 0, outs[dev], ins[dev], &uart->rmidi)) < 0)
+ goto _err;
sprintf(card->longname, "%s at 0x%lx, irq %d speed %d div %d outs %d ins %d adaptor %s droponfull %d",
card->shortname,
@@ -949,12 +945,18 @@ static int __init snd_serial_probe(int dev)
adaptor_names[uart->adaptor],
uart->drop_on_full);
- if ((err = snd_card_register(card)) < 0) {
- snd_card_free(card);
- return err;
- }
+ if ((err = snd_card_set_generic_dev(card)) < 0)
+ goto _err;
+
+ if ((err = snd_card_register(card)) < 0)
+ goto _err;
+
snd_serial_cards[dev] = card;
return 0;
+
+ _err:
+ snd_card_free(card);
+ return err;
}
static int __init alsa_card_serial_init(void)