summaryrefslogtreecommitdiffstats
path: root/sound/pci/ymfpci
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2005-10-10 11:56:31 +0200
committerJaroslav Kysela <perex@suse.cz>2005-11-04 13:18:00 +0100
commitb1d5776d865951c213a1caaab5d8bf5de7615dbd (patch)
treef999dca30f6e2d03a9176b86c613ae8f4531a6d6 /sound/pci/ymfpci
parent93f2e37840a9a7c3693ca6961fe6ad46b250f3b9 (diff)
[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 <tiwai@suse.de>
Diffstat (limited to 'sound/pci/ymfpci')
-rw-r--r--sound/pci/ymfpci/ymfpci.c16
-rw-r--r--sound/pci/ymfpci/ymfpci_main.c15
2 files changed, 7 insertions, 24 deletions
diff --git a/sound/pci/ymfpci/ymfpci.c b/sound/pci/ymfpci/ymfpci.c
index 2e69abe51aa9..e50d744ae706 100644
--- a/sound/pci/ymfpci/ymfpci.c
+++ b/sound/pci/ymfpci/ymfpci.c
@@ -130,8 +130,7 @@ static int __devinit snd_ymfpci_create_gameport(ymfpci_t *chip, int dev,
chip->gameport = gp = gameport_allocate_port();
if (!gp) {
printk(KERN_ERR "ymfpci: cannot allocate memory for gameport\n");
- release_resource(r);
- kfree_nocheck(r);
+ release_and_free_resource(r);
return -ENOMEM;
}
@@ -161,8 +160,7 @@ void snd_ymfpci_free_gameport(ymfpci_t *chip)
gameport_unregister_port(chip->gameport);
chip->gameport = NULL;
- release_resource(r);
- kfree_nocheck(r);
+ release_and_free_resource(r);
}
}
#else
@@ -267,14 +265,8 @@ static int __devinit snd_card_ymfpci_probe(struct pci_dev *pci,
old_legacy_ctrl,
&chip)) < 0) {
snd_card_free(card);
- if (mpu_res) {
- release_resource(mpu_res);
- kfree_nocheck(mpu_res);
- }
- if (fm_res) {
- release_resource(fm_res);
- kfree_nocheck(fm_res);
- }
+ release_and_free_resource(mpu_res);
+ release_and_free_resource(fm_res);
return err;
}
chip->fm_res = fm_res;
diff --git a/sound/pci/ymfpci/ymfpci_main.c b/sound/pci/ymfpci/ymfpci_main.c
index 2e671ee438c6..c0aaade772d4 100644
--- a/sound/pci/ymfpci/ymfpci_main.c
+++ b/sound/pci/ymfpci/ymfpci_main.c
@@ -2151,14 +2151,8 @@ static int snd_ymfpci_free(ymfpci_t *chip)
#ifdef CONFIG_PM
vfree(chip->saved_regs);
#endif
- if (chip->mpu_res) {
- release_resource(chip->mpu_res);
- kfree_nocheck(chip->mpu_res);
- }
- if (chip->fm_res) {
- release_resource(chip->fm_res);
- kfree_nocheck(chip->fm_res);
- }
+ release_and_free_resource(chip->mpu_res);
+ release_and_free_resource(chip->fm_res);
snd_ymfpci_free_gameport(chip);
if (chip->reg_area_virt)
iounmap(chip->reg_area_virt);
@@ -2167,10 +2161,7 @@ static int snd_ymfpci_free(ymfpci_t *chip)
if (chip->irq >= 0)
free_irq(chip->irq, (void *)chip);
- if (chip->res_reg_area) {
- release_resource(chip->res_reg_area);
- kfree_nocheck(chip->res_reg_area);
- }
+ release_and_free_resource(chip->res_reg_area);
pci_write_config_word(chip->pci, 0x40, chip->old_legacy_ctrl);