aboutsummaryrefslogtreecommitdiffstats
path: root/sound/isa/gus
diff options
context:
space:
mode:
Diffstat (limited to 'sound/isa/gus')
-rw-r--r--sound/isa/gus/gus_dma.c27
-rw-r--r--sound/isa/gus/gus_irq.c6
-rw-r--r--sound/isa/gus/gus_pcm.c26
-rw-r--r--sound/isa/gus/gus_uart.c10
-rw-r--r--sound/isa/gus/gusclassic.c6
-rw-r--r--sound/isa/gus/gusextreme.c6
-rw-r--r--sound/isa/gus/gusmax.c8
-rw-r--r--sound/isa/gus/interwave.c42
8 files changed, 82 insertions, 49 deletions
diff --git a/sound/isa/gus/gus_dma.c b/sound/isa/gus/gus_dma.c
index f45f6116c77a..36c27c832360 100644
--- a/sound/isa/gus/gus_dma.c
+++ b/sound/isa/gus/gus_dma.c
@@ -45,7 +45,8 @@ static void snd_gf1_dma_program(struct snd_gus_card * gus,
45 unsigned char dma_cmd; 45 unsigned char dma_cmd;
46 unsigned int address_high; 46 unsigned int address_high;
47 47
48 // snd_printk("dma_transfer: addr=0x%x, buf=0x%lx, count=0x%x\n", addr, (long) buf, count); 48 snd_printdd("dma_transfer: addr=0x%x, buf=0x%lx, count=0x%x\n",
49 addr, buf_addr, count);
49 50
50 if (gus->gf1.dma1 > 3) { 51 if (gus->gf1.dma1 > 3) {
51 if (gus->gf1.enh_mode) { 52 if (gus->gf1.enh_mode) {
@@ -77,7 +78,8 @@ static void snd_gf1_dma_program(struct snd_gus_card * gus,
77 snd_gf1_dma_ack(gus); 78 snd_gf1_dma_ack(gus);
78 snd_dma_program(gus->gf1.dma1, buf_addr, count, dma_cmd & SNDRV_GF1_DMA_READ ? DMA_MODE_READ : DMA_MODE_WRITE); 79 snd_dma_program(gus->gf1.dma1, buf_addr, count, dma_cmd & SNDRV_GF1_DMA_READ ? DMA_MODE_READ : DMA_MODE_WRITE);
79#if 0 80#if 0
80 snd_printk("address = 0x%x, count = 0x%x, dma_cmd = 0x%x\n", address << 1, count, dma_cmd); 81 snd_printk(KERN_DEBUG "address = 0x%x, count = 0x%x, dma_cmd = 0x%x\n",
82 address << 1, count, dma_cmd);
81#endif 83#endif
82 spin_lock_irqsave(&gus->reg_lock, flags); 84 spin_lock_irqsave(&gus->reg_lock, flags);
83 if (gus->gf1.enh_mode) { 85 if (gus->gf1.enh_mode) {
@@ -142,7 +144,9 @@ static void snd_gf1_dma_interrupt(struct snd_gus_card * gus)
142 snd_gf1_dma_program(gus, block->addr, block->buf_addr, block->count, (unsigned short) block->cmd); 144 snd_gf1_dma_program(gus, block->addr, block->buf_addr, block->count, (unsigned short) block->cmd);
143 kfree(block); 145 kfree(block);
144#if 0 146#if 0
145 printk("program dma (IRQ) - addr = 0x%x, buffer = 0x%lx, count = 0x%x, cmd = 0x%x\n", addr, (long) buffer, count, cmd); 147 snd_printd(KERN_DEBUG "program dma (IRQ) - "
148 "addr = 0x%x, buffer = 0x%lx, count = 0x%x, cmd = 0x%x\n",
149 block->addr, block->buf_addr, block->count, block->cmd);
146#endif 150#endif
147} 151}
148 152
@@ -203,13 +207,16 @@ int snd_gf1_dma_transfer_block(struct snd_gus_card * gus,
203 } 207 }
204 *block = *__block; 208 *block = *__block;
205 block->next = NULL; 209 block->next = NULL;
206#if 0 210
207 printk("addr = 0x%x, buffer = 0x%lx, count = 0x%x, cmd = 0x%x\n", block->addr, (long) block->buffer, block->count, block->cmd); 211 snd_printdd("addr = 0x%x, buffer = 0x%lx, count = 0x%x, cmd = 0x%x\n",
208#endif 212 block->addr, (long) block->buffer, block->count,
209#if 0 213 block->cmd);
210 printk("gus->gf1.dma_data_pcm_last = 0x%lx\n", (long)gus->gf1.dma_data_pcm_last); 214
211 printk("gus->gf1.dma_data_pcm = 0x%lx\n", (long)gus->gf1.dma_data_pcm); 215 snd_printdd("gus->gf1.dma_data_pcm_last = 0x%lx\n",
212#endif 216 (long)gus->gf1.dma_data_pcm_last);
217 snd_printdd("gus->gf1.dma_data_pcm = 0x%lx\n",
218 (long)gus->gf1.dma_data_pcm);
219
213 spin_lock_irqsave(&gus->dma_lock, flags); 220 spin_lock_irqsave(&gus->dma_lock, flags);
214 if (synth) { 221 if (synth) {
215 if (gus->gf1.dma_data_synth_last) { 222 if (gus->gf1.dma_data_synth_last) {
diff --git a/sound/isa/gus/gus_irq.c b/sound/isa/gus/gus_irq.c
index 041894ddd014..2055aff71b50 100644
--- a/sound/isa/gus/gus_irq.c
+++ b/sound/isa/gus/gus_irq.c
@@ -41,7 +41,7 @@ __again:
41 if (status == 0) 41 if (status == 0)
42 return IRQ_RETVAL(handled); 42 return IRQ_RETVAL(handled);
43 handled = 1; 43 handled = 1;
44 // snd_printk("IRQ: status = 0x%x\n", status); 44 /* snd_printk(KERN_DEBUG "IRQ: status = 0x%x\n", status); */
45 if (status & 0x02) { 45 if (status & 0x02) {
46 STAT_ADD(gus->gf1.interrupt_stat_midi_in); 46 STAT_ADD(gus->gf1.interrupt_stat_midi_in);
47 if (gus->gf1.interrupt_handler_midi_in) 47 if (gus->gf1.interrupt_handler_midi_in)
@@ -65,7 +65,9 @@ __again:
65 continue; /* multi request */ 65 continue; /* multi request */
66 already |= _current_; /* mark request */ 66 already |= _current_; /* mark request */
67#if 0 67#if 0
68 printk("voice = %i, voice_status = 0x%x, voice_verify = %i\n", voice, voice_status, inb(GUSP(gus, GF1PAGE))); 68 printk(KERN_DEBUG "voice = %i, voice_status = 0x%x, "
69 "voice_verify = %i\n",
70 voice, voice_status, inb(GUSP(gus, GF1PAGE)));
69#endif 71#endif
70 pvoice = &gus->gf1.voices[voice]; 72 pvoice = &gus->gf1.voices[voice];
71 if (pvoice->use) { 73 if (pvoice->use) {
diff --git a/sound/isa/gus/gus_pcm.c b/sound/isa/gus/gus_pcm.c
index 38510aeb21c6..edb11eefdfe3 100644
--- a/sound/isa/gus/gus_pcm.c
+++ b/sound/isa/gus/gus_pcm.c
@@ -82,7 +82,10 @@ static int snd_gf1_pcm_block_change(struct snd_pcm_substream *substream,
82 82
83 count += offset & 31; 83 count += offset & 31;
84 offset &= ~31; 84 offset &= ~31;
85 // snd_printk("block change - offset = 0x%x, count = 0x%x\n", offset, count); 85 /*
86 snd_printk(KERN_DEBUG "block change - offset = 0x%x, count = 0x%x\n",
87 offset, count);
88 */
86 memset(&block, 0, sizeof(block)); 89 memset(&block, 0, sizeof(block));
87 block.cmd = SNDRV_GF1_DMA_IRQ; 90 block.cmd = SNDRV_GF1_DMA_IRQ;
88 if (snd_pcm_format_unsigned(runtime->format)) 91 if (snd_pcm_format_unsigned(runtime->format))
@@ -135,7 +138,11 @@ static void snd_gf1_pcm_trigger_up(struct snd_pcm_substream *substream)
135 curr = begin + (pcmp->bpos * pcmp->block_size) / runtime->channels; 138 curr = begin + (pcmp->bpos * pcmp->block_size) / runtime->channels;
136 end = curr + (pcmp->block_size / runtime->channels); 139 end = curr + (pcmp->block_size / runtime->channels);
137 end -= snd_pcm_format_width(runtime->format) == 16 ? 2 : 1; 140 end -= snd_pcm_format_width(runtime->format) == 16 ? 2 : 1;
138 // snd_printk("init: curr=0x%x, begin=0x%x, end=0x%x, ctrl=0x%x, ramp=0x%x, rate=0x%x\n", curr, begin, end, voice_ctrl, ramp_ctrl, rate); 141 /*
142 snd_printk(KERN_DEBUG "init: curr=0x%x, begin=0x%x, end=0x%x, "
143 "ctrl=0x%x, ramp=0x%x, rate=0x%x\n",
144 curr, begin, end, voice_ctrl, ramp_ctrl, rate);
145 */
139 pan = runtime->channels == 2 ? (!voice ? 1 : 14) : 8; 146 pan = runtime->channels == 2 ? (!voice ? 1 : 14) : 8;
140 vol = !voice ? gus->gf1.pcm_volume_level_left : gus->gf1.pcm_volume_level_right; 147 vol = !voice ? gus->gf1.pcm_volume_level_left : gus->gf1.pcm_volume_level_right;
141 spin_lock_irqsave(&gus->reg_lock, flags); 148 spin_lock_irqsave(&gus->reg_lock, flags);
@@ -205,9 +212,11 @@ static void snd_gf1_pcm_interrupt_wave(struct snd_gus_card * gus,
205 ramp_ctrl = (snd_gf1_read8(gus, SNDRV_GF1_VB_VOLUME_CONTROL) & ~0xa4) | 0x03; 212 ramp_ctrl = (snd_gf1_read8(gus, SNDRV_GF1_VB_VOLUME_CONTROL) & ~0xa4) | 0x03;
206#if 0 213#if 0
207 snd_gf1_select_voice(gus, pvoice->number); 214 snd_gf1_select_voice(gus, pvoice->number);
208 printk("position = 0x%x\n", (snd_gf1_read_addr(gus, SNDRV_GF1_VA_CURRENT, voice_ctrl & 4) >> 4)); 215 printk(KERN_DEBUG "position = 0x%x\n",
216 (snd_gf1_read_addr(gus, SNDRV_GF1_VA_CURRENT, voice_ctrl & 4) >> 4));
209 snd_gf1_select_voice(gus, pcmp->pvoices[1]->number); 217 snd_gf1_select_voice(gus, pcmp->pvoices[1]->number);
210 printk("position = 0x%x\n", (snd_gf1_read_addr(gus, SNDRV_GF1_VA_CURRENT, voice_ctrl & 4) >> 4)); 218 printk(KERN_DEBUG "position = 0x%x\n",
219 (snd_gf1_read_addr(gus, SNDRV_GF1_VA_CURRENT, voice_ctrl & 4) >> 4));
211 snd_gf1_select_voice(gus, pvoice->number); 220 snd_gf1_select_voice(gus, pvoice->number);
212#endif 221#endif
213 pcmp->bpos++; 222 pcmp->bpos++;
@@ -299,7 +308,11 @@ static int snd_gf1_pcm_poke_block(struct snd_gus_card *gus, unsigned char *buf,
299 unsigned int len; 308 unsigned int len;
300 unsigned long flags; 309 unsigned long flags;
301 310
302 // printk("poke block; buf = 0x%x, pos = %i, count = %i, port = 0x%x\n", (int)buf, pos, count, gus->gf1.port); 311 /*
312 printk(KERN_DEBUG
313 "poke block; buf = 0x%x, pos = %i, count = %i, port = 0x%x\n",
314 (int)buf, pos, count, gus->gf1.port);
315 */
303 while (count > 0) { 316 while (count > 0) {
304 len = count; 317 len = count;
305 if (len > 512) /* limit, to allow IRQ */ 318 if (len > 512) /* limit, to allow IRQ */
@@ -680,7 +693,8 @@ static int snd_gf1_pcm_playback_open(struct snd_pcm_substream *substream)
680 runtime->private_free = snd_gf1_pcm_playback_free; 693 runtime->private_free = snd_gf1_pcm_playback_free;
681 694
682#if 0 695#if 0
683 printk("playback.buffer = 0x%lx, gf1.pcm_buffer = 0x%lx\n", (long) pcm->playback.buffer, (long) gus->gf1.pcm_buffer); 696 printk(KERN_DEBUG "playback.buffer = 0x%lx, gf1.pcm_buffer = 0x%lx\n",
697 (long) pcm->playback.buffer, (long) gus->gf1.pcm_buffer);
684#endif 698#endif
685 if ((err = snd_gf1_dma_init(gus)) < 0) 699 if ((err = snd_gf1_dma_init(gus)) < 0)
686 return err; 700 return err;
diff --git a/sound/isa/gus/gus_uart.c b/sound/isa/gus/gus_uart.c
index f0af3f79b08b..21cc42e4c4be 100644
--- a/sound/isa/gus/gus_uart.c
+++ b/sound/isa/gus/gus_uart.c
@@ -129,8 +129,14 @@ static int snd_gf1_uart_input_open(struct snd_rawmidi_substream *substream)
129 } 129 }
130 spin_unlock_irqrestore(&gus->uart_cmd_lock, flags); 130 spin_unlock_irqrestore(&gus->uart_cmd_lock, flags);
131#if 0 131#if 0
132 snd_printk("read init - enable = %i, cmd = 0x%x, stat = 0x%x\n", gus->uart_enable, gus->gf1.uart_cmd, snd_gf1_uart_stat(gus)); 132 snd_printk(KERN_DEBUG
133 snd_printk("[0x%x] reg (ctrl/status) = 0x%x, reg (data) = 0x%x (page = 0x%x)\n", gus->gf1.port + 0x100, inb(gus->gf1.port + 0x100), inb(gus->gf1.port + 0x101), inb(gus->gf1.port + 0x102)); 133 "read init - enable = %i, cmd = 0x%x, stat = 0x%x\n",
134 gus->uart_enable, gus->gf1.uart_cmd, snd_gf1_uart_stat(gus));
135 snd_printk(KERN_DEBUG
136 "[0x%x] reg (ctrl/status) = 0x%x, reg (data) = 0x%x "
137 "(page = 0x%x)\n",
138 gus->gf1.port + 0x100, inb(gus->gf1.port + 0x100),
139 inb(gus->gf1.port + 0x101), inb(gus->gf1.port + 0x102));
134#endif 140#endif
135 return 0; 141 return 0;
136} 142}
diff --git a/sound/isa/gus/gusclassic.c b/sound/isa/gus/gusclassic.c
index 426532a4d730..086b8f0e0f94 100644
--- a/sound/isa/gus/gusclassic.c
+++ b/sound/isa/gus/gusclassic.c
@@ -148,9 +148,9 @@ static int __devinit snd_gusclassic_probe(struct device *dev, unsigned int n)
148 struct snd_gus_card *gus; 148 struct snd_gus_card *gus;
149 int error; 149 int error;
150 150
151 card = snd_card_new(index[n], id[n], THIS_MODULE, 0); 151 error = snd_card_create(index[n], id[n], THIS_MODULE, 0, &card);
152 if (!card) 152 if (error < 0)
153 return -EINVAL; 153 return error;
154 154
155 if (pcm_channels[n] < 2) 155 if (pcm_channels[n] < 2)
156 pcm_channels[n] = 2; 156 pcm_channels[n] = 2;
diff --git a/sound/isa/gus/gusextreme.c b/sound/isa/gus/gusextreme.c
index 7ad4c3b41a84..180a8dea6bd9 100644
--- a/sound/isa/gus/gusextreme.c
+++ b/sound/isa/gus/gusextreme.c
@@ -241,9 +241,9 @@ static int __devinit snd_gusextreme_probe(struct device *dev, unsigned int n)
241 struct snd_opl3 *opl3; 241 struct snd_opl3 *opl3;
242 int error; 242 int error;
243 243
244 card = snd_card_new(index[n], id[n], THIS_MODULE, 0); 244 error = snd_card_create(index[n], id[n], THIS_MODULE, 0, &card);
245 if (!card) 245 if (error < 0)
246 return -EINVAL; 246 return error;
247 247
248 if (mpu_port[n] == SNDRV_AUTO_PORT) 248 if (mpu_port[n] == SNDRV_AUTO_PORT)
249 mpu_port[n] = 0; 249 mpu_port[n] = 0;
diff --git a/sound/isa/gus/gusmax.c b/sound/isa/gus/gusmax.c
index f94c1976e632..f26eac8d8110 100644
--- a/sound/isa/gus/gusmax.c
+++ b/sound/isa/gus/gusmax.c
@@ -214,10 +214,10 @@ static int __devinit snd_gusmax_probe(struct device *pdev, unsigned int dev)
214 struct snd_wss *wss; 214 struct snd_wss *wss;
215 struct snd_gusmax *maxcard; 215 struct snd_gusmax *maxcard;
216 216
217 card = snd_card_new(index[dev], id[dev], THIS_MODULE, 217 err = snd_card_create(index[dev], id[dev], THIS_MODULE,
218 sizeof(struct snd_gusmax)); 218 sizeof(struct snd_gusmax), &card);
219 if (card == NULL) 219 if (err < 0)
220 return -ENOMEM; 220 return err;
221 card->private_free = snd_gusmax_free; 221 card->private_free = snd_gusmax_free;
222 maxcard = (struct snd_gusmax *)card->private_data; 222 maxcard = (struct snd_gusmax *)card->private_data;
223 maxcard->card = card; 223 maxcard->card = card;
diff --git a/sound/isa/gus/interwave.c b/sound/isa/gus/interwave.c
index 5faecfb602d3..534a6eced2b8 100644
--- a/sound/isa/gus/interwave.c
+++ b/sound/isa/gus/interwave.c
@@ -170,7 +170,7 @@ static void snd_interwave_i2c_setlines(struct snd_i2c_bus *bus, int ctrl, int da
170 unsigned long port = bus->private_value; 170 unsigned long port = bus->private_value;
171 171
172#if 0 172#if 0
173 printk("i2c_setlines - 0x%lx <- %i,%i\n", port, ctrl, data); 173 printk(KERN_DEBUG "i2c_setlines - 0x%lx <- %i,%i\n", port, ctrl, data);
174#endif 174#endif
175 outb((data << 1) | ctrl, port); 175 outb((data << 1) | ctrl, port);
176 udelay(10); 176 udelay(10);
@@ -183,7 +183,7 @@ static int snd_interwave_i2c_getclockline(struct snd_i2c_bus *bus)
183 183
184 res = inb(port) & 1; 184 res = inb(port) & 1;
185#if 0 185#if 0
186 printk("i2c_getclockline - 0x%lx -> %i\n", port, res); 186 printk(KERN_DEBUG "i2c_getclockline - 0x%lx -> %i\n", port, res);
187#endif 187#endif
188 return res; 188 return res;
189} 189}
@@ -197,7 +197,7 @@ static int snd_interwave_i2c_getdataline(struct snd_i2c_bus *bus, int ack)
197 udelay(10); 197 udelay(10);
198 res = (inb(port) & 2) >> 1; 198 res = (inb(port) & 2) >> 1;
199#if 0 199#if 0
200 printk("i2c_getdataline - 0x%lx -> %i\n", port, res); 200 printk(KERN_DEBUG "i2c_getdataline - 0x%lx -> %i\n", port, res);
201#endif 201#endif
202 return res; 202 return res;
203} 203}
@@ -342,7 +342,8 @@ static void __devinit snd_interwave_bank_sizes(struct snd_gus_card * gus, int *s
342 snd_gf1_poke(gus, local, d); 342 snd_gf1_poke(gus, local, d);
343 snd_gf1_poke(gus, local + 1, d + 1); 343 snd_gf1_poke(gus, local + 1, d + 1);
344#if 0 344#if 0
345 printk("d = 0x%x, local = 0x%x, local + 1 = 0x%x, idx << 22 = 0x%x\n", 345 printk(KERN_DEBUG "d = 0x%x, local = 0x%x, "
346 "local + 1 = 0x%x, idx << 22 = 0x%x\n",
346 d, 347 d,
347 snd_gf1_peek(gus, local), 348 snd_gf1_peek(gus, local),
348 snd_gf1_peek(gus, local + 1), 349 snd_gf1_peek(gus, local + 1),
@@ -356,7 +357,8 @@ static void __devinit snd_interwave_bank_sizes(struct snd_gus_card * gus, int *s
356 } 357 }
357 } 358 }
358#if 0 359#if 0
359 printk("sizes: %i %i %i %i\n", sizes[0], sizes[1], sizes[2], sizes[3]); 360 printk(KERN_DEBUG "sizes: %i %i %i %i\n",
361 sizes[0], sizes[1], sizes[2], sizes[3]);
360#endif 362#endif
361} 363}
362 364
@@ -410,12 +412,12 @@ static void __devinit snd_interwave_detect_memory(struct snd_gus_card * gus)
410 lmct = (psizes[3] << 24) | (psizes[2] << 16) | 412 lmct = (psizes[3] << 24) | (psizes[2] << 16) |
411 (psizes[1] << 8) | psizes[0]; 413 (psizes[1] << 8) | psizes[0];
412#if 0 414#if 0
413 printk("lmct = 0x%08x\n", lmct); 415 printk(KERN_DEBUG "lmct = 0x%08x\n", lmct);
414#endif 416#endif
415 for (i = 0; i < ARRAY_SIZE(lmc); i++) 417 for (i = 0; i < ARRAY_SIZE(lmc); i++)
416 if (lmct == lmc[i]) { 418 if (lmct == lmc[i]) {
417#if 0 419#if 0
418 printk("found !!! %i\n", i); 420 printk(KERN_DEBUG "found !!! %i\n", i);
419#endif 421#endif
420 snd_gf1_write16(gus, SNDRV_GF1_GW_MEMORY_CONFIG, (snd_gf1_look16(gus, SNDRV_GF1_GW_MEMORY_CONFIG) & 0xfff0) | i); 422 snd_gf1_write16(gus, SNDRV_GF1_GW_MEMORY_CONFIG, (snd_gf1_look16(gus, SNDRV_GF1_GW_MEMORY_CONFIG) & 0xfff0) | i);
421 snd_interwave_bank_sizes(gus, psizes); 423 snd_interwave_bank_sizes(gus, psizes);
@@ -626,20 +628,22 @@ static void snd_interwave_free(struct snd_card *card)
626 free_irq(iwcard->irq, (void *)iwcard); 628 free_irq(iwcard->irq, (void *)iwcard);
627} 629}
628 630
629static struct snd_card *snd_interwave_card_new(int dev) 631static int snd_interwave_card_new(int dev, struct snd_card **cardp)
630{ 632{
631 struct snd_card *card; 633 struct snd_card *card;
632 struct snd_interwave *iwcard; 634 struct snd_interwave *iwcard;
635 int err;
633 636
634 card = snd_card_new(index[dev], id[dev], THIS_MODULE, 637 err = snd_card_create(index[dev], id[dev], THIS_MODULE,
635 sizeof(struct snd_interwave)); 638 sizeof(struct snd_interwave), &card);
636 if (card == NULL) 639 if (err < 0)
637 return NULL; 640 return err;
638 iwcard = card->private_data; 641 iwcard = card->private_data;
639 iwcard->card = card; 642 iwcard->card = card;
640 iwcard->irq = -1; 643 iwcard->irq = -1;
641 card->private_free = snd_interwave_free; 644 card->private_free = snd_interwave_free;
642 return card; 645 *cardp = card;
646 return 0;
643} 647}
644 648
645static int __devinit snd_interwave_probe(struct snd_card *card, int dev) 649static int __devinit snd_interwave_probe(struct snd_card *card, int dev)
@@ -778,9 +782,9 @@ static int __devinit snd_interwave_isa_probe1(int dev, struct device *devptr)
778 struct snd_card *card; 782 struct snd_card *card;
779 int err; 783 int err;
780 784
781 card = snd_interwave_card_new(dev); 785 err = snd_interwave_card_new(dev, &card);
782 if (! card) 786 if (err < 0)
783 return -ENOMEM; 787 return err;
784 788
785 snd_card_set_dev(card, devptr); 789 snd_card_set_dev(card, devptr);
786 if ((err = snd_interwave_probe(card, dev)) < 0) { 790 if ((err = snd_interwave_probe(card, dev)) < 0) {
@@ -876,9 +880,9 @@ static int __devinit snd_interwave_pnp_detect(struct pnp_card_link *pcard,
876 if (dev >= SNDRV_CARDS) 880 if (dev >= SNDRV_CARDS)
877 return -ENODEV; 881 return -ENODEV;
878 882
879 card = snd_interwave_card_new(dev); 883 res = snd_interwave_card_new(dev, &card);
880 if (! card) 884 if (res < 0)
881 return -ENOMEM; 885 return res;
882 886
883 if ((res = snd_interwave_pnp(dev, card->private_data, pcard, pid)) < 0) { 887 if ((res = snd_interwave_pnp(dev, card->private_data, pcard, pid)) < 0) {
884 snd_card_free(card); 888 snd_card_free(card);