From 988aec3de5f0fa848f26fbf64f9e83364d6b3c25 Mon Sep 17 00:00:00 2001 From: Ondrej Zary Date: Wed, 1 Aug 2012 16:05:39 +0200 Subject: 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 Signed-off-by: Takashi Iwai --- sound/isa/opti9xx/miro.c | 15 +-------------- sound/isa/opti9xx/opti92x-ad1848.c | 14 +------------- 2 files changed, 2 insertions(+), 27 deletions(-) (limited to 'sound/isa') diff --git a/sound/isa/opti9xx/miro.c b/sound/isa/opti9xx/miro.c index c24594c866f..3d1afb612b3 100644 --- a/sound/isa/opti9xx/miro.c +++ b/sound/isa/opti9xx/miro.c @@ -37,6 +37,7 @@ #include #include #include +#define SNDRV_LEGACY_FIND_FREE_IOPORT #define SNDRV_LEGACY_FIND_FREE_IRQ #define SNDRV_LEGACY_FIND_FREE_DMA #include @@ -770,20 +771,6 @@ static int __devinit snd_miro_mixer(struct snd_card *card, return 0; } -static long snd_legacy_find_free_ioport(long *port_table, long size) -{ - while (*port_table != -1) { - struct resource *res; - if ((res = request_region(*port_table, size, - "ALSA test")) != NULL) { - release_and_free_resource(res); - return *port_table; - } - port_table++; - } - return -1; -} - static int __devinit snd_miro_init(struct snd_miro *chip, unsigned short hardware) { diff --git a/sound/isa/opti9xx/opti92x-ad1848.c b/sound/isa/opti9xx/opti92x-ad1848.c index f8fbe22515c..2899c9fd1ce 100644 --- a/sound/isa/opti9xx/opti92x-ad1848.c +++ b/sound/isa/opti9xx/opti92x-ad1848.c @@ -39,6 +39,7 @@ #ifndef OPTi93X #include #endif +#define SNDRV_LEGACY_FIND_FREE_IOPORT #define SNDRV_LEGACY_FIND_FREE_IRQ #define SNDRV_LEGACY_FIND_FREE_DMA #include @@ -185,19 +186,6 @@ static char * snd_opti9xx_names[] = { "82C930", "82C931", "82C933" }; - -static long __devinit snd_legacy_find_free_ioport(long *port_table, long size) -{ - while (*port_table != -1) { - if (request_region(*port_table, size, "ALSA test")) { - release_region(*port_table, size); - return *port_table; - } - port_table++; - } - return -1; -} - static int __devinit snd_opti9xx_init(struct snd_opti9xx *chip, unsigned short hardware) { -- cgit v1.2.3