diff options
author | Ondrej Zary <linux@rainbow-software.org> | 2012-08-01 18:05:39 +0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2012-08-03 14:57:44 +0400 |
commit | 988aec3de5f0fa848f26fbf64f9e83364d6b3c25 (patch) | |
tree | 44dba73a859c16b6cc8f14074bf8e793a781a82e /include/sound | |
parent | 0d7614f09c1ebdbaa1599a5aba7593f147bf96ee (diff) | |
download | linux-988aec3de5f0fa848f26fbf64f9e83364d6b3c25.tar.xz |
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>
Diffstat (limited to 'include/sound')
-rw-r--r-- | include/sound/initval.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/include/sound/initval.h b/include/sound/initval.h index f99a0d2ddfe7..ac62c67e6f42 100644 --- a/include/sound/initval.h +++ b/include/sound/initval.h @@ -50,6 +50,20 @@ #define SNDRV_DEFAULT_DMA_SIZE { [0 ... (SNDRV_CARDS-1)] = SNDRV_AUTO_DMA_SIZE } #define SNDRV_DEFAULT_PTR SNDRV_DEFAULT_STR +#ifdef SNDRV_LEGACY_FIND_FREE_IOPORT +static long 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; +} +#endif + #ifdef SNDRV_LEGACY_FIND_FREE_IRQ #include <linux/interrupt.h> |