diff options
Diffstat (limited to 'sound/drivers/mpu401/mpu401.c')
-rw-r--r-- | sound/drivers/mpu401/mpu401.c | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/sound/drivers/mpu401/mpu401.c b/sound/drivers/mpu401/mpu401.c index cb36ecb78697..54e2ff9b5ca1 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) | |||
77 | strcat(card->longname, "polled"); | 77 | strcat(card->longname, "polled"); |
78 | } | 78 | } |
79 | 79 | ||
80 | if (snd_mpu401_uart_new(card, 0, | 80 | if ((err = snd_mpu401_uart_new(card, 0, |
81 | MPU401_HW_MPU401, | 81 | MPU401_HW_MPU401, |
82 | port[dev], 0, | 82 | port[dev], 0, |
83 | irq[dev], irq[dev] >= 0 ? SA_INTERRUPT : 0, NULL) < 0) { | 83 | irq[dev], irq[dev] >= 0 ? SA_INTERRUPT : 0, NULL)) < 0) { |
84 | printk(KERN_ERR "MPU401 not detected at 0x%lx\n", port[dev]); | 84 | printk(KERN_ERR "MPU401 not detected at 0x%lx\n", port[dev]); |
85 | snd_card_free(card); | 85 | goto _err; |
86 | return -ENODEV; | ||
87 | } | ||
88 | if ((err = snd_card_register(card)) < 0) { | ||
89 | snd_card_free(card); | ||
90 | return err; | ||
91 | } | 86 | } |
87 | |||
88 | if ((err = snd_card_set_generic_dev(card)) < 0) | ||
89 | goto _err; | ||
90 | |||
91 | if ((err = snd_card_register(card)) < 0) | ||
92 | goto _err; | ||
93 | |||
92 | *rcard = card; | 94 | *rcard = card; |
93 | return 0; | 95 | return 0; |
96 | |||
97 | _err: | ||
98 | snd_card_free(card); | ||
99 | return err; | ||
94 | } | 100 | } |
95 | 101 | ||
96 | static int __devinit snd_mpu401_probe(int dev) | 102 | static int __devinit snd_mpu401_probe(int dev) |