diff options
author | Ondrej Zary <linux@rainbow-software.org> | 2012-08-01 10:05:39 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2012-08-03 06:57:44 -0400 |
commit | 988aec3de5f0fa848f26fbf64f9e83364d6b3c25 (patch) | |
tree | 44dba73a859c16b6cc8f14074bf8e793a781a82e /sound/isa | |
parent | 0d7614f09c1ebdbaa1599a5aba7593f147bf96ee (diff) |
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 'sound/isa')
-rw-r--r-- | sound/isa/opti9xx/miro.c | 15 | ||||
-rw-r--r-- | sound/isa/opti9xx/opti92x-ad1848.c | 14 |
2 files changed, 2 insertions, 27 deletions
diff --git a/sound/isa/opti9xx/miro.c b/sound/isa/opti9xx/miro.c index c24594c866f4..3d1afb612b35 100644 --- a/sound/isa/opti9xx/miro.c +++ b/sound/isa/opti9xx/miro.c | |||
@@ -37,6 +37,7 @@ | |||
37 | #include <sound/opl4.h> | 37 | #include <sound/opl4.h> |
38 | #include <sound/control.h> | 38 | #include <sound/control.h> |
39 | #include <sound/info.h> | 39 | #include <sound/info.h> |
40 | #define SNDRV_LEGACY_FIND_FREE_IOPORT | ||
40 | #define SNDRV_LEGACY_FIND_FREE_IRQ | 41 | #define SNDRV_LEGACY_FIND_FREE_IRQ |
41 | #define SNDRV_LEGACY_FIND_FREE_DMA | 42 | #define SNDRV_LEGACY_FIND_FREE_DMA |
42 | #include <sound/initval.h> | 43 | #include <sound/initval.h> |
@@ -770,20 +771,6 @@ static int __devinit snd_miro_mixer(struct snd_card *card, | |||
770 | return 0; | 771 | return 0; |
771 | } | 772 | } |
772 | 773 | ||
773 | static long snd_legacy_find_free_ioport(long *port_table, long size) | ||
774 | { | ||
775 | while (*port_table != -1) { | ||
776 | struct resource *res; | ||
777 | if ((res = request_region(*port_table, size, | ||
778 | "ALSA test")) != NULL) { | ||
779 | release_and_free_resource(res); | ||
780 | return *port_table; | ||
781 | } | ||
782 | port_table++; | ||
783 | } | ||
784 | return -1; | ||
785 | } | ||
786 | |||
787 | static int __devinit snd_miro_init(struct snd_miro *chip, | 774 | static int __devinit snd_miro_init(struct snd_miro *chip, |
788 | unsigned short hardware) | 775 | unsigned short hardware) |
789 | { | 776 | { |
diff --git a/sound/isa/opti9xx/opti92x-ad1848.c b/sound/isa/opti9xx/opti92x-ad1848.c index f8fbe22515c9..2899c9fd1ceb 100644 --- a/sound/isa/opti9xx/opti92x-ad1848.c +++ b/sound/isa/opti9xx/opti92x-ad1848.c | |||
@@ -39,6 +39,7 @@ | |||
39 | #ifndef OPTi93X | 39 | #ifndef OPTi93X |
40 | #include <sound/opl4.h> | 40 | #include <sound/opl4.h> |
41 | #endif | 41 | #endif |
42 | #define SNDRV_LEGACY_FIND_FREE_IOPORT | ||
42 | #define SNDRV_LEGACY_FIND_FREE_IRQ | 43 | #define SNDRV_LEGACY_FIND_FREE_IRQ |
43 | #define SNDRV_LEGACY_FIND_FREE_DMA | 44 | #define SNDRV_LEGACY_FIND_FREE_DMA |
44 | #include <sound/initval.h> | 45 | #include <sound/initval.h> |
@@ -185,19 +186,6 @@ static char * snd_opti9xx_names[] = { | |||
185 | "82C930", "82C931", "82C933" | 186 | "82C930", "82C931", "82C933" |
186 | }; | 187 | }; |
187 | 188 | ||
188 | |||
189 | static long __devinit snd_legacy_find_free_ioport(long *port_table, long size) | ||
190 | { | ||
191 | while (*port_table != -1) { | ||
192 | if (request_region(*port_table, size, "ALSA test")) { | ||
193 | release_region(*port_table, size); | ||
194 | return *port_table; | ||
195 | } | ||
196 | port_table++; | ||
197 | } | ||
198 | return -1; | ||
199 | } | ||
200 | |||
201 | static int __devinit snd_opti9xx_init(struct snd_opti9xx *chip, | 189 | static int __devinit snd_opti9xx_init(struct snd_opti9xx *chip, |
202 | unsigned short hardware) | 190 | unsigned short hardware) |
203 | { | 191 | { |