diff options
Diffstat (limited to 'sound/isa/sb/sb8.c')
-rw-r--r-- | sound/isa/sb/sb8.c | 62 |
1 files changed, 31 insertions, 31 deletions
diff --git a/sound/isa/sb/sb8.c b/sound/isa/sb/sb8.c index e2cbc4202b3d..c41ac25e85ca 100644 --- a/sound/isa/sb/sb8.c +++ b/sound/isa/sb/sb8.c | |||
@@ -107,54 +107,47 @@ static int __init snd_sb8_probe(int dev) | |||
107 | dma8[dev], | 107 | dma8[dev], |
108 | -1, | 108 | -1, |
109 | SB_HW_AUTO, | 109 | SB_HW_AUTO, |
110 | &chip)) < 0) { | 110 | &chip)) < 0) |
111 | snd_card_free(card); | 111 | goto _err; |
112 | return err; | 112 | |
113 | } | ||
114 | if (chip->hardware >= SB_HW_16) { | 113 | if (chip->hardware >= SB_HW_16) { |
115 | snd_card_free(card); | ||
116 | if (chip->hardware == SB_HW_ALS100) | 114 | if (chip->hardware == SB_HW_ALS100) |
117 | snd_printdd("ALS100 chip detected at 0x%lx, try snd-als100 module\n", | 115 | snd_printk(KERN_WARNING "ALS100 chip detected at 0x%lx, try snd-als100 module\n", |
118 | port[dev]); | 116 | port[dev]); |
119 | else | 117 | else |
120 | snd_printdd("SB 16 chip detected at 0x%lx, try snd-sb16 module\n", | 118 | snd_printk(KERN_WARNING "SB 16 chip detected at 0x%lx, try snd-sb16 module\n", |
121 | port[dev]); | 119 | port[dev]); |
122 | return -ENODEV; | 120 | err = -ENODEV; |
121 | goto _err; | ||
123 | } | 122 | } |
124 | 123 | ||
125 | if ((err = snd_sb8dsp_pcm(chip, 0, NULL)) < 0) { | 124 | if ((err = snd_sb8dsp_pcm(chip, 0, NULL)) < 0) |
126 | snd_card_free(card); | 125 | goto _err; |
127 | return err; | 126 | |
128 | } | 127 | if ((err = snd_sbmixer_new(chip)) < 0) |
129 | if ((err = snd_sbmixer_new(chip)) < 0) { | 128 | goto _err; |
130 | snd_card_free(card); | 129 | |
131 | return err; | ||
132 | } | ||
133 | if (chip->hardware == SB_HW_10 || chip->hardware == SB_HW_20) { | 130 | if (chip->hardware == SB_HW_10 || chip->hardware == SB_HW_20) { |
134 | if ((err = snd_opl3_create(card, chip->port + 8, 0, | 131 | if ((err = snd_opl3_create(card, chip->port + 8, 0, |
135 | OPL3_HW_AUTO, 1, | 132 | OPL3_HW_AUTO, 1, |
136 | &opl3)) < 0) { | 133 | &opl3)) < 0) { |
137 | snd_printk(KERN_ERR "sb8: no OPL device at 0x%lx\n", chip->port + 8); | 134 | snd_printk(KERN_WARNING "sb8: no OPL device at 0x%lx\n", chip->port + 8); |
138 | } | 135 | } |
139 | } else { | 136 | } else { |
140 | if ((err = snd_opl3_create(card, chip->port, chip->port + 2, | 137 | if ((err = snd_opl3_create(card, chip->port, chip->port + 2, |
141 | OPL3_HW_AUTO, 1, | 138 | OPL3_HW_AUTO, 1, |
142 | &opl3)) < 0) { | 139 | &opl3)) < 0) { |
143 | snd_printk(KERN_ERR "sb8: no OPL device at 0x%lx-0x%lx\n", | 140 | snd_printk(KERN_WARNING "sb8: no OPL device at 0x%lx-0x%lx\n", |
144 | chip->port, chip->port + 2); | 141 | chip->port, chip->port + 2); |
145 | } | 142 | } |
146 | } | 143 | } |
147 | if (err >= 0) { | 144 | if (err >= 0) { |
148 | if ((err = snd_opl3_hwdep_new(opl3, 0, 1, NULL)) < 0) { | 145 | if ((err = snd_opl3_hwdep_new(opl3, 0, 1, NULL)) < 0) |
149 | snd_card_free(card); | 146 | goto _err; |
150 | return err; | ||
151 | } | ||
152 | } | 147 | } |
153 | 148 | ||
154 | if ((err = snd_sb8dsp_midi(chip, 0, NULL)) < 0) { | 149 | if ((err = snd_sb8dsp_midi(chip, 0, NULL)) < 0) |
155 | snd_card_free(card); | 150 | goto _err; |
156 | return err; | ||
157 | } | ||
158 | 151 | ||
159 | strcpy(card->driver, chip->hardware == SB_HW_PRO ? "SB Pro" : "SB8"); | 152 | strcpy(card->driver, chip->hardware == SB_HW_PRO ? "SB Pro" : "SB8"); |
160 | strcpy(card->shortname, chip->name); | 153 | strcpy(card->shortname, chip->name); |
@@ -162,12 +155,19 @@ static int __init snd_sb8_probe(int dev) | |||
162 | chip->name, | 155 | chip->name, |
163 | chip->port, | 156 | chip->port, |
164 | irq[dev], dma8[dev]); | 157 | irq[dev], dma8[dev]); |
165 | if ((err = snd_card_register(card)) < 0) { | 158 | |
166 | snd_card_free(card); | 159 | if ((err = snd_card_set_generic_dev(card)) < 0) |
167 | return err; | 160 | goto _err; |
168 | } | 161 | |
162 | if ((err = snd_card_register(card)) < 0) | ||
163 | goto _err; | ||
164 | |||
169 | snd_sb8_cards[dev] = card; | 165 | snd_sb8_cards[dev] = card; |
170 | return 0; | 166 | return 0; |
167 | |||
168 | _err: | ||
169 | snd_card_free(card); | ||
170 | return err; | ||
171 | } | 171 | } |
172 | 172 | ||
173 | static int __init snd_card_sb8_legacy_auto_probe(unsigned long xport) | 173 | static int __init snd_card_sb8_legacy_auto_probe(unsigned long xport) |