Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ALSA: isa: Move snd_legacy_find_free_ioport to initval.h

Move snd_legacy_find_free_ioport() function back to initval.h as it is used
by two drivers.

Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>

authored by

Ondrej Zary and committed by
Takashi Iwai
988aec3d 0d7614f0

+16 -27
+14
include/sound/initval.h
··· 50 50 #define SNDRV_DEFAULT_DMA_SIZE { [0 ... (SNDRV_CARDS-1)] = SNDRV_AUTO_DMA_SIZE } 51 51 #define SNDRV_DEFAULT_PTR SNDRV_DEFAULT_STR 52 52 53 + #ifdef SNDRV_LEGACY_FIND_FREE_IOPORT 54 + static long snd_legacy_find_free_ioport(long *port_table, long size) 55 + { 56 + while (*port_table != -1) { 57 + if (request_region(*port_table, size, "ALSA test")) { 58 + release_region(*port_table, size); 59 + return *port_table; 60 + } 61 + port_table++; 62 + } 63 + return -1; 64 + } 65 + #endif 66 + 53 67 #ifdef SNDRV_LEGACY_FIND_FREE_IRQ 54 68 #include <linux/interrupt.h> 55 69
+1 -14
sound/isa/opti9xx/miro.c
··· 37 37 #include <sound/opl4.h> 38 38 #include <sound/control.h> 39 39 #include <sound/info.h> 40 + #define SNDRV_LEGACY_FIND_FREE_IOPORT 40 41 #define SNDRV_LEGACY_FIND_FREE_IRQ 41 42 #define SNDRV_LEGACY_FIND_FREE_DMA 42 43 #include <sound/initval.h> ··· 769 768 } 770 769 771 770 return 0; 772 - } 773 - 774 - static long snd_legacy_find_free_ioport(long *port_table, long size) 775 - { 776 - while (*port_table != -1) { 777 - struct resource *res; 778 - if ((res = request_region(*port_table, size, 779 - "ALSA test")) != NULL) { 780 - release_and_free_resource(res); 781 - return *port_table; 782 - } 783 - port_table++; 784 - } 785 - return -1; 786 771 } 787 772 788 773 static int __devinit snd_miro_init(struct snd_miro *chip,
+1 -13
sound/isa/opti9xx/opti92x-ad1848.c
··· 39 39 #ifndef OPTi93X 40 40 #include <sound/opl4.h> 41 41 #endif 42 + #define SNDRV_LEGACY_FIND_FREE_IOPORT 42 43 #define SNDRV_LEGACY_FIND_FREE_IRQ 43 44 #define SNDRV_LEGACY_FIND_FREE_DMA 44 45 #include <sound/initval.h> ··· 185 184 "82C924", "82C925", 186 185 "82C930", "82C931", "82C933" 187 186 }; 188 - 189 - 190 - static long __devinit snd_legacy_find_free_ioport(long *port_table, long size) 191 - { 192 - while (*port_table != -1) { 193 - if (request_region(*port_table, size, "ALSA test")) { 194 - release_region(*port_table, size); 195 - return *port_table; 196 - } 197 - port_table++; 198 - } 199 - return -1; 200 - } 201 187 202 188 static int __devinit snd_opti9xx_init(struct snd_opti9xx *chip, 203 189 unsigned short hardware)