aboutsummaryrefslogtreecommitdiffstats
path: root/sound/drivers
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/drivers
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/drivers')
-rw-r--r--sound/drivers/mpu401/mpu401_uart.c5
-rw-r--r--sound/drivers/mtpav.c5
-rw-r--r--sound/drivers/opl3/opl3_lib.c10
-rw-r--r--sound/drivers/opl4/opl4_lib.c10
-rw-r--r--sound/drivers/serial-u16550.c5
-rw-r--r--sound/drivers/vx/vx_pcm.c4
6 files changed, 9 insertions, 30 deletions
diff --git a/sound/drivers/mpu401/mpu401_uart.c b/sound/drivers/mpu401/mpu401_uart.c
index fe3f921ffbe3..bdeb2c00dac5 100644
--- a/sound/drivers/mpu401/mpu401_uart.c
+++ b/sound/drivers/mpu401/mpu401_uart.c
@@ -423,10 +423,7 @@ static void snd_mpu401_uart_free(snd_rawmidi_t *rmidi)
423 mpu401_t *mpu = rmidi->private_data; 423 mpu401_t *mpu = rmidi->private_data;
424 if (mpu->irq_flags && mpu->irq >= 0) 424 if (mpu->irq_flags && mpu->irq >= 0)
425 free_irq(mpu->irq, (void *) mpu); 425 free_irq(mpu->irq, (void *) mpu);
426 if (mpu->res) { 426 release_and_free_resource(mpu->res);
427 release_resource(mpu->res);
428 kfree_nocheck(mpu->res);
429 }
430 kfree(mpu); 427 kfree(mpu);
431} 428}
432 429
diff --git a/sound/drivers/mtpav.c b/sound/drivers/mtpav.c
index 3a25c89d2983..e9d52c668edc 100644
--- a/sound/drivers/mtpav.c
+++ b/sound/drivers/mtpav.c
@@ -717,10 +717,7 @@ static void free_mtpav(mtpav_t * crd)
717 spin_unlock_irqrestore(&crd->spinlock, flags); 717 spin_unlock_irqrestore(&crd->spinlock, flags);
718 if (crd->irq >= 0) 718 if (crd->irq >= 0)
719 free_irq(crd->irq, (void *)crd); 719 free_irq(crd->irq, (void *)crd);
720 if (crd->res_port) { 720 release_and_free_resource(crd->res_port);
721 release_resource(crd->res_port);
722 kfree_nocheck(crd->res_port);
723 }
724 kfree(crd); 721 kfree(crd);
725} 722}
726 723
diff --git a/sound/drivers/opl3/opl3_lib.c b/sound/drivers/opl3/opl3_lib.c
index 1f84d78260de..06246503083c 100644
--- a/sound/drivers/opl3/opl3_lib.c
+++ b/sound/drivers/opl3/opl3_lib.c
@@ -325,14 +325,8 @@ static int snd_opl3_free(opl3_t *opl3)
325 snd_assert(opl3 != NULL, return -ENXIO); 325 snd_assert(opl3 != NULL, return -ENXIO);
326 if (opl3->private_free) 326 if (opl3->private_free)
327 opl3->private_free(opl3); 327 opl3->private_free(opl3);
328 if (opl3->res_l_port) { 328 release_and_free_resource(opl3->res_l_port);
329 release_resource(opl3->res_l_port); 329 release_and_free_resource(opl3->res_r_port);
330 kfree_nocheck(opl3->res_l_port);
331 }
332 if (opl3->res_r_port) {
333 release_resource(opl3->res_r_port);
334 kfree_nocheck(opl3->res_r_port);
335 }
336 kfree(opl3); 330 kfree(opl3);
337 return 0; 331 return 0;
338} 332}
diff --git a/sound/drivers/opl4/opl4_lib.c b/sound/drivers/opl4/opl4_lib.c
index 380c2c704c54..4ae5dd8f011e 100644
--- a/sound/drivers/opl4/opl4_lib.c
+++ b/sound/drivers/opl4/opl4_lib.c
@@ -169,14 +169,8 @@ static void snd_opl4_free(opl4_t *opl4)
169#ifdef CONFIG_PROC_FS 169#ifdef CONFIG_PROC_FS
170 snd_opl4_free_proc(opl4); 170 snd_opl4_free_proc(opl4);
171#endif 171#endif
172 if (opl4->res_fm_port) { 172 release_and_free_resource(opl4->res_fm_port);
173 release_resource(opl4->res_fm_port); 173 release_and_free_resource(opl4->res_pcm_port);
174 kfree_nocheck(opl4->res_fm_port);
175 }
176 if (opl4->res_pcm_port) {
177 release_resource(opl4->res_pcm_port);
178 kfree_nocheck(opl4->res_pcm_port);
179 }
180 kfree(opl4); 174 kfree(opl4);
181} 175}
182 176
diff --git a/sound/drivers/serial-u16550.c b/sound/drivers/serial-u16550.c
index 416172ea1f47..1ed58df42671 100644
--- a/sound/drivers/serial-u16550.c
+++ b/sound/drivers/serial-u16550.c
@@ -749,10 +749,7 @@ static int snd_uart16550_free(snd_uart16550_t *uart)
749{ 749{
750 if (uart->irq >= 0) 750 if (uart->irq >= 0)
751 free_irq(uart->irq, (void *)uart); 751 free_irq(uart->irq, (void *)uart);
752 if (uart->res_base) { 752 release_and_free_resource(uart->res_base);
753 release_resource(uart->res_base);
754 kfree_nocheck(uart->res_base);
755 }
756 kfree(uart); 753 kfree(uart);
757 return 0; 754 return 0;
758}; 755};
diff --git a/sound/drivers/vx/vx_pcm.c b/sound/drivers/vx/vx_pcm.c
index c2312d912fc7..2b46758fe86f 100644
--- a/sound/drivers/vx/vx_pcm.c
+++ b/sound/drivers/vx/vx_pcm.c
@@ -79,7 +79,7 @@ static int snd_pcm_alloc_vmalloc_buffer(snd_pcm_substream_t *subs, size_t size)
79 /* already allocated */ 79 /* already allocated */
80 if (runtime->dma_bytes >= size) 80 if (runtime->dma_bytes >= size)
81 return 0; /* already enough large */ 81 return 0; /* already enough large */
82 vfree_nocheck(runtime->dma_area); /* bypass the memory wrapper */ 82 vfree(runtime->dma_area);
83 } 83 }
84 runtime->dma_area = vmalloc_32(size); 84 runtime->dma_area = vmalloc_32(size);
85 if (! runtime->dma_area) 85 if (! runtime->dma_area)
@@ -98,7 +98,7 @@ static int snd_pcm_free_vmalloc_buffer(snd_pcm_substream_t *subs)
98{ 98{
99 snd_pcm_runtime_t *runtime = subs->runtime; 99 snd_pcm_runtime_t *runtime = subs->runtime;
100 if (runtime->dma_area) { 100 if (runtime->dma_area) {
101 vfree_nocheck(runtime->dma_area); /* bypass the memory wrapper */ 101 vfree(runtime->dma_area);
102 runtime->dma_area = NULL; 102 runtime->dma_area = NULL;
103 } 103 }
104 return 0; 104 return 0;