aboutsummaryrefslogtreecommitdiffstats
path: root/sound/drivers/serial-u16550.c
diff options
context:
space:
mode:
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 986df35fb829..fd3bb9dd1d24 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)
928 base[dev], 928 base[dev],
929 adaptor[dev], 929 adaptor[dev],
930 droponfull[dev], 930 droponfull[dev],
931 &uart)) < 0) { 931 &uart)) < 0)
932 snd_card_free(card); 932 goto _err;
933 return err;
934 }
935 933
936 if ((err = snd_uart16550_rmidi(uart, 0, outs[dev], ins[dev], &uart->rmidi)) < 0) { 934 if ((err = snd_uart16550_rmidi(uart, 0, outs[dev], ins[dev], &uart->rmidi)) < 0)
937 snd_card_free(card); 935 goto _err;
938 return err;
939 }
940 936
941 sprintf(card->longname, "%s at 0x%lx, irq %d speed %d div %d outs %d ins %d adaptor %s droponfull %d", 937 sprintf(card->longname, "%s at 0x%lx, irq %d speed %d div %d outs %d ins %d adaptor %s droponfull %d",
942 card->shortname, 938 card->shortname,
@@ -949,12 +945,18 @@ static int __init snd_serial_probe(int dev)
949 adaptor_names[uart->adaptor], 945 adaptor_names[uart->adaptor],
950 uart->drop_on_full); 946 uart->drop_on_full);
951 947
952 if ((err = snd_card_register(card)) < 0) { 948 if ((err = snd_card_set_generic_dev(card)) < 0)
953 snd_card_free(card); 949 goto _err;
954 return err; 950
955 } 951 if ((err = snd_card_register(card)) < 0)
952 goto _err;
953
956 snd_serial_cards[dev] = card; 954 snd_serial_cards[dev] = card;
957 return 0; 955 return 0;
956
957 _err:
958 snd_card_free(card);
959 return err;
958} 960}
959 961
960static int __init alsa_card_serial_init(void) 962static int __init alsa_card_serial_init(void)