]> err.no Git - linux-2.6/blobdiff - sound/pci/echoaudio/echoaudio.c
[ALSA] Conversions from kmalloc+memset to k(z|c)alloc
[linux-2.6] / sound / pci / echoaudio / echoaudio.c
index e695502f71353366522c5df72dcff4525b76d4f3..c3dafa29054f96c618c1c824830ec06623c47014 100644 (file)
@@ -236,9 +236,9 @@ static int pcm_open(struct snd_pcm_substream *substream,
        chip = snd_pcm_substream_chip(substream);
        runtime = substream->runtime;
 
-       if (!(pipe = kmalloc(sizeof(struct audiopipe), GFP_KERNEL)))
+       pipe = kzalloc(sizeof(struct audiopipe), GFP_KERNEL);
+       if (!pipe)
                return -ENOMEM;
-       memset(pipe, 0, sizeof(struct audiopipe));
        pipe->index = -1;               /* Not configured yet */
 
        /* Set up hw capabilities and contraints */
@@ -1878,10 +1878,9 @@ static int snd_echo_free(struct echoaudio *chip)
        if (chip->dsp_registers)
                iounmap(chip->dsp_registers);
 
-       if (chip->iores) {
-               release_resource(chip->iores);
-               kfree_nocheck(chip->iores);
-       }
+       if (chip->iores)
+               release_and_free_resource(chip->iores);
+
        DE_INIT(("MMIO freed.\n"));
 
        pci_disable_device(chip->pci);
@@ -1952,7 +1951,7 @@ static __devinit int snd_echo_create(struct snd_card *card,
        chip->dsp_registers = (volatile u32 __iomem *)
                ioremap_nocache(chip->dsp_registers_phys, sz);
 
-       if (request_irq(pci->irq, snd_echo_interrupt, SA_INTERRUPT | SA_SHIRQ,
+       if (request_irq(pci->irq, snd_echo_interrupt, IRQF_DISABLED | IRQF_SHARED,
                                                ECHOCARD_NAME, (void *)chip)) {
                snd_echo_free(chip);
                snd_printk(KERN_ERR "cannot grab irq\n");