aboutsummaryrefslogtreecommitdiffstats
path: root/sound/isa/opti9xx/opti92x-ad1848.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/isa/opti9xx/opti92x-ad1848.c')
-rw-r--r--sound/isa/opti9xx/opti92x-ad1848.c25
1 files changed, 7 insertions, 18 deletions
diff --git a/sound/isa/opti9xx/opti92x-ad1848.c b/sound/isa/opti9xx/opti92x-ad1848.c
index 73573cb1db6a..b94339f8306f 100644
--- a/sound/isa/opti9xx/opti92x-ad1848.c
+++ b/sound/isa/opti9xx/opti92x-ad1848.c
@@ -299,10 +299,8 @@ static char * snd_opti9xx_names[] = {
299static long snd_legacy_find_free_ioport(long *port_table, long size) 299static long snd_legacy_find_free_ioport(long *port_table, long size)
300{ 300{
301 while (*port_table != -1) { 301 while (*port_table != -1) {
302 struct resource *res; 302 if (request_region(*port_table, size, "ALSA test")) {
303 if ((res = request_region(*port_table, size, "ALSA test")) != NULL) { 303 release_region(*port_table, size);
304 release_resource(res);
305 kfree_nocheck(res);
306 return *port_table; 304 return *port_table;
307 } 305 }
308 port_table++; 306 port_table++;
@@ -1227,10 +1225,7 @@ static int snd_opti93x_probe(opti93x_t *chip)
1227 1225
1228static int snd_opti93x_free(opti93x_t *chip) 1226static int snd_opti93x_free(opti93x_t *chip)
1229{ 1227{
1230 if (chip->res_port) { 1228 release_and_free_resource(chip->res_port);
1231 release_resource(chip->res_port);
1232 kfree_nocheck(chip->res_port);
1233 }
1234 if (chip->dma1 >= 0) { 1229 if (chip->dma1 >= 0) {
1235 disable_dma(chip->dma1); 1230 disable_dma(chip->dma1);
1236 free_dma(chip->dma1); 1231 free_dma(chip->dma1);
@@ -1656,8 +1651,7 @@ static int __devinit snd_card_opti9xx_detect(snd_card_t *card, opti9xx_t *chip)
1656 if (value == snd_opti9xx_read(chip, OPTi9XX_MC_REG(1))) 1651 if (value == snd_opti9xx_read(chip, OPTi9XX_MC_REG(1)))
1657 return 1; 1652 return 1;
1658 1653
1659 release_resource(chip->res_mc_base); 1654 release_and_free_resource(chip->res_mc_base);
1660 kfree_nocheck(chip->res_mc_base);
1661 chip->res_mc_base = NULL; 1655 chip->res_mc_base = NULL;
1662 1656
1663 } 1657 }
@@ -1683,8 +1677,7 @@ static int __devinit snd_card_opti9xx_detect(snd_card_t *card, opti9xx_t *chip)
1683 if (snd_opti9xx_read(chip, OPTi9XX_MC_REG(7)) == 0xff - value) 1677 if (snd_opti9xx_read(chip, OPTi9XX_MC_REG(7)) == 0xff - value)
1684 return 1; 1678 return 1;
1685 1679
1686 release_resource(chip->res_mc_base); 1680 release_and_free_resource(chip->res_mc_base);
1687 kfree_nocheck(chip->res_mc_base);
1688 chip->res_mc_base = NULL; 1681 chip->res_mc_base = NULL;
1689 } 1682 }
1690#endif /* OPTi93X */ 1683#endif /* OPTi93X */
@@ -1886,12 +1879,8 @@ static void snd_card_opti9xx_free(snd_card_t *card)
1886{ 1879{
1887 opti9xx_t *chip = (opti9xx_t *)card->private_data; 1880 opti9xx_t *chip = (opti9xx_t *)card->private_data;
1888 1881
1889 if (chip) { 1882 if (chip)
1890 if (chip->res_mc_base) { 1883 release_and_free_resource(chip->res_mc_base);
1891 release_resource(chip->res_mc_base);
1892 kfree_nocheck(chip->res_mc_base);
1893 }
1894 }
1895} 1884}
1896 1885
1897static int snd_card_opti9xx_probe(struct pnp_card_link *pcard, 1886static int snd_card_opti9xx_probe(struct pnp_card_link *pcard,