Update of /cvsroot/alsa/alsa-kernel/isa/opti9xx
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13034/isa/opti9xx
Modified Files:
opti92x-ad1848.c
Log Message:
fixed the code with obsolete check_region().
Index: opti92x-ad1848.c
===================================================================
RCS file: /cvsroot/alsa/alsa-kernel/isa/opti9xx/opti92x-ad1848.c,v
retrieving revision 1.40
retrieving revision 1.41
diff -u -r1.40 -r1.41
--- opti92x-ad1848.c 2 Mar 2004 15:38:14 -0000 1.40
+++ opti92x-ad1848.c 5 Mar 2004 11:57:59 -0000 1.41
@@ -311,8 +311,12 @@
static long snd_legacy_find_free_ioport(long *port_table, long size)
{
while (*port_table != -1) {
- if (!check_region(*port_table, size))
+ struct resource *res;
+ if ((res = request_region(*port_table, size, "ALSA test")) != NULL) {
+ release_resource(res);
+ kfree_nocheck(res);
return *port_table;
+ }
port_table++;
}
return -1;
@@ -1674,13 +1678,18 @@
if ((err = snd_opti9xx_init(chip, i)) < 0)
return err;
- if (check_region(chip->mc_base, chip->mc_base_size))
+ if ((chip->res_mc_base = request_region(chip->mc_base,
chip->mc_base_size, "OPTi9xx MC")) == NULL)
continue;
value = snd_opti9xx_read(chip, OPTi9XX_MC_REG(1));
if ((value != 0xff) && (value != inb(chip->mc_base + 1)))
if (value == snd_opti9xx_read(chip, OPTi9XX_MC_REG(1)))
return 1;
+
+ release_resource(chip->res_mc_base);
+ kfree_nocheck(chip->res_mc_base);
+ chip->res_mc_base = NULL;
+
}
#else /* OPTi93X */
for (i = OPTi9XX_HW_82C931; i >= OPTi9XX_HW_82C930; i--) {
@@ -1690,7 +1699,7 @@
if ((err = snd_opti9xx_init(chip, i)) < 0)
return err;
- if (check_region(chip->mc_base, chip->mc_base_size))
+ if ((chip->res_mc_base = request_region(chip->mc_base,
chip->mc_base_size, "OPTi9xx MC")) == NULL)
continue;
spin_lock_irqsave(&chip->lock, flags);
@@ -1703,6 +1712,10 @@
snd_opti9xx_write(chip, OPTi9XX_MC_REG(7), 0xff - value);
if (snd_opti9xx_read(chip, OPTi9XX_MC_REG(7)) == 0xff - value)
return 1;
+
+ release_resource(chip->res_mc_base);
+ kfree_nocheck(chip->res_mc_base);
+ chip->res_mc_base = NULL;
}
#endif /* OPTi93X */
@@ -1986,7 +1999,8 @@
}
#endif /* CONFIG_PNP */
- if ((chip->res_mc_base = request_region(chip->mc_base, chip->mc_base_size,
"OPTi9xx MC")) == NULL) {
+ if (! chip->res_mc_base &&
+ (chip->res_mc_base = request_region(chip->mc_base, chip->mc_base_size,
"OPTi9xx MC")) == NULL) {
snd_card_free(card);
return -ENOMEM;
}
-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
Alsa-cvslog mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/alsa-cvslog