aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/ymfpci
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2005-10-10 05:56:31 -0400
committerJaroslav Kysela <perex@suse.cz>2005-11-04 07:18:00 -0500
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,
130 chip->gameport = gp = gameport_allocate_port(); 130 chip->gameport = gp = gameport_allocate_port();
131 if (!gp) { 131 if (!gp) {
132 printk(KERN_ERR "ymfpci: cannot allocate memory for gameport\n"); 132 printk(KERN_ERR "ymfpci: cannot allocate memory for gameport\n");
133 release_resource(r); 133 release_and_free_resource(r);
134 kfree_nocheck(r);
135 return -ENOMEM; 134 return -ENOMEM;
136 } 135 }
137 136
@@ -161,8 +160,7 @@ void snd_ymfpci_free_gameport(ymfpci_t *chip)
161 gameport_unregister_port(chip->gameport); 160 gameport_unregister_port(chip->gameport);
162 chip->gameport = NULL; 161 chip->gameport = NULL;
163 162
164 release_resource(r); 163 release_and_free_resource(r);
165 kfree_nocheck(r);
166 } 164 }
167} 165}
168#else 166#else
@@ -267,14 +265,8 @@ static int __devinit snd_card_ymfpci_probe(struct pci_dev *pci,
267 old_legacy_ctrl, 265 old_legacy_ctrl,
268 &chip)) < 0) { 266 &chip)) < 0) {
269 snd_card_free(card); 267 snd_card_free(card);
270 if (mpu_res) { 268 release_and_free_resource(mpu_res);
271 release_resource(mpu_res); 269 release_and_free_resource(fm_res);
272 kfree_nocheck(mpu_res);
273 }
274 if (fm_res) {
275 release_resource(fm_res);
276 kfree_nocheck(fm_res);
277 }
278 return err; 270 return err;
279 } 271 }
280 chip->fm_res = fm_res; 272 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)
2151#ifdef CONFIG_PM 2151#ifdef CONFIG_PM
2152 vfree(chip->saved_regs); 2152 vfree(chip->saved_regs);
2153#endif 2153#endif
2154 if (chip->mpu_res) { 2154 release_and_free_resource(chip->mpu_res);
2155 release_resource(chip->mpu_res); 2155 release_and_free_resource(chip->fm_res);
2156 kfree_nocheck(chip->mpu_res);
2157 }
2158 if (chip->fm_res) {
2159 release_resource(chip->fm_res);
2160 kfree_nocheck(chip->fm_res);
2161 }
2162 snd_ymfpci_free_gameport(chip); 2156 snd_ymfpci_free_gameport(chip);
2163 if (chip->reg_area_virt) 2157 if (chip->reg_area_virt)
2164 iounmap(chip->reg_area_virt); 2158 iounmap(chip->reg_area_virt);
@@ -2167,10 +2161,7 @@ static int snd_ymfpci_free(ymfpci_t *chip)
2167 2161
2168 if (chip->irq >= 0) 2162 if (chip->irq >= 0)
2169 free_irq(chip->irq, (void *)chip); 2163 free_irq(chip->irq, (void *)chip);
2170 if (chip->res_reg_area) { 2164 release_and_free_resource(chip->res_reg_area);
2171 release_resource(chip->res_reg_area);
2172 kfree_nocheck(chip->res_reg_area);
2173 }
2174 2165
2175 pci_write_config_word(chip->pci, 0x40, chip->old_legacy_ctrl); 2166 pci_write_config_word(chip->pci, 0x40, chip->old_legacy_ctrl);
2176 2167