From b1d5776d865951c213a1caaab5d8bf5de7615dbd Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Mon, 10 Oct 2005 11:56:31 +0200 Subject: [ALSA] Remove vmalloc wrapper, kfree_nocheck() - Remove vmalloc wrapper - Add release_and_free_resource() to remove kfree_nocheck() from each driver and simplify the code Signed-off-by: Takashi Iwai --- sound/pci/via82xx.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'sound/pci/via82xx.c') diff --git a/sound/pci/via82xx.c b/sound/pci/via82xx.c index b2779fb7d1a9..b0302c369c3d 100644 --- a/sound/pci/via82xx.c +++ b/sound/pci/via82xx.c @@ -1655,8 +1655,7 @@ static int __devinit snd_via686_create_gameport(via82xx_t *chip, unsigned char * chip->gameport = gp = gameport_allocate_port(); if (!gp) { printk(KERN_ERR "via82xx: cannot allocate memory for gameport\n"); - release_resource(r); - kfree_nocheck(r); + release_and_free_resource(r); return -ENOMEM; } @@ -1682,8 +1681,7 @@ static void snd_via686_free_gameport(via82xx_t *chip) gameport_unregister_port(chip->gameport); chip->gameport = NULL; - release_resource(r); - kfree_nocheck(r); + release_and_free_resource(r); } } #else @@ -2023,10 +2021,7 @@ static int snd_via82xx_free(via82xx_t *chip) __end_hw: if (chip->irq >= 0) free_irq(chip->irq, (void *)chip); - if (chip->mpu_res) { - release_resource(chip->mpu_res); - kfree_nocheck(chip->mpu_res); - } + release_and_free_resource(chip->mpu_res); pci_release_regions(chip->pci); if (chip->chip_type == TYPE_VIA686) { -- cgit v1.2.3