diff options
Diffstat (limited to 'sound/isa/gus/interwave.c')
-rw-r--r-- | sound/isa/gus/interwave.c | 42 |
1 files changed, 23 insertions, 19 deletions
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 | ||
629 | static struct snd_card *snd_interwave_card_new(int dev) | 631 | static 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 | ||
645 | static int __devinit snd_interwave_probe(struct snd_card *card, int dev) | 649 | static 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); |