X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=sound%2Fpci%2Fes1968.c;h=ac8294e21cc17eeb8ee3a28fe747ba49bdea461b;hb=56f87b82171245a81a5dbac5e703d3941d80da49;hp=9d7a2878393060f303bf1974571995311d29b046;hpb=bcf7e34a71afe24dc210b7825f6f139774cb905c;p=powerpc.git diff --git a/sound/pci/es1968.c b/sound/pci/es1968.c index 9d7a287839..ac8294e21c 100644 --- a/sound/pci/es1968.c +++ b/sound/pci/es1968.c @@ -160,25 +160,6 @@ MODULE_PARM_DESC(joystick, "Enable joystick."); #endif -/* PCI Dev ID's */ - -#ifndef PCI_VENDOR_ID_ESS -#define PCI_VENDOR_ID_ESS 0x125D -#endif - -#define PCI_VENDOR_ID_ESS_OLD 0x1285 /* Platform Tech, the people the ESS - was bought form */ - -#ifndef PCI_DEVICE_ID_ESS_M2E -#define PCI_DEVICE_ID_ESS_M2E 0x1978 -#endif -#ifndef PCI_DEVICE_ID_ESS_M2 -#define PCI_DEVICE_ID_ESS_M2 0x1968 -#endif -#ifndef PCI_DEVICE_ID_ESS_M1 -#define PCI_DEVICE_ID_ESS_M1 0x0100 -#endif - #define NR_APUS 64 #define NR_APU_REGS 16 @@ -1481,13 +1462,13 @@ snd_es1968_init_dmabuf(es1968_t *chip) snd_dma_pci_data(chip->pci), chip->total_bufsize, &chip->dma); if (err < 0 || ! chip->dma.area) { - snd_printk("es1968: can't allocate dma pages for size %d\n", + snd_printk(KERN_ERR "es1968: can't allocate dma pages for size %d\n", chip->total_bufsize); return -ENOMEM; } if ((chip->dma.addr + chip->dma.bytes - 1) & ~((1 << 28) - 1)) { snd_dma_free_pages(&chip->dma); - snd_printk("es1968: DMA buffer beyond 256MB.\n"); + snd_printk(KERN_ERR "es1968: DMA buffer beyond 256MB.\n"); return -ENOMEM; } } @@ -1596,7 +1577,7 @@ static int snd_es1968_playback_open(snd_pcm_substream_t *substream) if (apu1 < 0) return apu1; - es = kcalloc(1, sizeof(*es), GFP_KERNEL); + es = kzalloc(sizeof(*es), GFP_KERNEL); if (!es) { snd_es1968_free_apu_pair(chip, apu1); return -ENOMEM; @@ -1641,7 +1622,7 @@ static int snd_es1968_capture_open(snd_pcm_substream_t *substream) return apu2; } - es = kcalloc(1, sizeof(*es), GFP_KERNEL); + es = kzalloc(sizeof(*es), GFP_KERNEL); if (!es) { snd_es1968_free_apu_pair(chip, apu1); snd_es1968_free_apu_pair(chip, apu2); @@ -1760,11 +1741,11 @@ static void __devinit es1968_measure_clock(es1968_t *chip) /* search 2 APUs (although one apu is enough) */ if ((apu = snd_es1968_alloc_apu_pair(chip, ESM_APU_PCM_PLAY)) < 0) { - snd_printk("Hmm, cannot find empty APU pair!?\n"); + snd_printk(KERN_ERR "Hmm, cannot find empty APU pair!?\n"); return; } if ((memory = snd_es1968_new_memory(chip, CLOCK_MEASURE_BUFSIZE)) == NULL) { - snd_printk("cannot allocate dma buffer - using default clock %d\n", chip->clock); + snd_printk(KERN_ERR "cannot allocate dma buffer - using default clock %d\n", chip->clock); snd_es1968_free_apu_pair(chip, apu); return; } @@ -1825,7 +1806,7 @@ static void __devinit es1968_measure_clock(es1968_t *chip) else t += stop_time.tv_usec - start_time.tv_usec; if (t == 0) { - snd_printk("?? calculation error..\n"); + snd_printk(KERN_ERR "?? calculation error..\n"); } else { offset *= 1000; offset = (offset / t) * 1000 + ((offset % t) * 1000) / t; @@ -2109,7 +2090,7 @@ static void snd_es1968_ac97_reset(es1968_t *chip) outw(inw(ioaddr + 0x3c) & 0xfffc, ioaddr + 0x3c); #if 0 /* the loop here needs to be much better if we want it.. */ - snd_printk("trying software reset\n"); + snd_printk(KERN_INFO "trying software reset\n"); /* try and do a software reset */ outb(0x80 | 0x7c, ioaddr + 0x30); for (w = 0;; w++) { @@ -2480,8 +2461,7 @@ static int __devinit snd_es1968_create_gameport(es1968_t *chip, int dev) chip->gameport = gp = gameport_allocate_port(); if (!gp) { printk(KERN_ERR "es1968: cannot allocate memory for gameport\n"); - release_resource(r); - kfree_nocheck(r); + release_and_free_resource(r); return -ENOMEM; } @@ -2507,8 +2487,7 @@ static void snd_es1968_free_gameport(es1968_t *chip) gameport_unregister_port(chip->gameport); chip->gameport = NULL; - release_resource(r); - kfree_nocheck(r); + release_and_free_resource(r); } } #else @@ -2583,12 +2562,12 @@ static int __devinit snd_es1968_create(snd_card_t * card, /* check, if we can restrict PCI DMA transfers to 28 bits */ if (pci_set_dma_mask(pci, 0x0fffffff) < 0 || pci_set_consistent_dma_mask(pci, 0x0fffffff) < 0) { - snd_printk("architecture does not support 28bit PCI busmaster DMA\n"); + snd_printk(KERN_ERR "architecture does not support 28bit PCI busmaster DMA\n"); pci_disable_device(pci); return -ENXIO; } - chip = kcalloc(1, sizeof(*chip), GFP_KERNEL); + chip = kzalloc(sizeof(*chip), GFP_KERNEL); if (! chip) { pci_disable_device(pci); return -ENOMEM; @@ -2618,7 +2597,7 @@ static int __devinit snd_es1968_create(snd_card_t * card, chip->io_port = pci_resource_start(pci, 0); if (request_irq(pci->irq, snd_es1968_interrupt, SA_INTERRUPT|SA_SHIRQ, "ESS Maestro", (void*)chip)) { - snd_printk("unable to grab IRQ %d\n", pci->irq); + snd_printk(KERN_ERR "unable to grab IRQ %d\n", pci->irq); snd_es1968_free(chip); return -EBUSY; } @@ -2782,6 +2761,7 @@ static void __devexit snd_es1968_remove(struct pci_dev *pci) static struct pci_driver driver = { .name = "ES1968 (ESS Maestro)", + .owner = THIS_MODULE, .id_table = snd_es1968_ids, .probe = snd_es1968_probe, .remove = __devexit_p(snd_es1968_remove),