aboutsummaryrefslogtreecommitdiff
path: root/sound/isa/cs423x
diff options
context:
space:
mode:
Diffstat (limited to 'sound/isa/cs423x')
-rw-r--r--sound/isa/cs423x/cs4231_lib.c10
-rw-r--r--sound/isa/cs423x/cs4236.c8
-rw-r--r--sound/isa/cs423x/cs4236_lib.c5
3 files changed, 8 insertions, 15 deletions
diff --git a/sound/isa/cs423x/cs4231_lib.c b/sound/isa/cs423x/cs4231_lib.c
index 32318258cd8..4af769030be 100644
--- a/sound/isa/cs423x/cs4231_lib.c
+++ b/sound/isa/cs423x/cs4231_lib.c
@@ -1417,14 +1417,8 @@ static int snd_cs4231_pm_resume(snd_card_t *card)
static int snd_cs4231_free(cs4231_t *chip)
{
- if (chip->res_port) {
- release_resource(chip->res_port);
- kfree_nocheck(chip->res_port);
- }
- if (chip->res_cport) {
- release_resource(chip->res_cport);
- kfree_nocheck(chip->res_cport);
- }
+ release_and_free_resource(chip->res_port);
+ release_and_free_resource(chip->res_cport);
if (chip->irq >= 0) {
disable_irq(chip->irq);
if (!(chip->hwshare & CS4231_HWSHARE_IRQ))
diff --git a/sound/isa/cs423x/cs4236.c b/sound/isa/cs423x/cs4236.c
index d28315dc72f..d60a55e6a0b 100644
--- a/sound/isa/cs423x/cs4236.c
+++ b/sound/isa/cs423x/cs4236.c
@@ -379,12 +379,8 @@ static void snd_card_cs4236_free(snd_card_t *card)
{
struct snd_card_cs4236 *acard = (struct snd_card_cs4236 *)card->private_data;
- if (acard) {
- if (acard->res_sb_port) {
- release_resource(acard->res_sb_port);
- kfree_nocheck(acard->res_sb_port);
- }
- }
+ if (acard)
+ release_and_free_resource(acard->res_sb_port);
}
#ifdef CONFIG_PNP
diff --git a/sound/isa/cs423x/cs4236_lib.c b/sound/isa/cs423x/cs4236_lib.c
index 2128d4bdef4..1adb88d5f8f 100644
--- a/sound/isa/cs423x/cs4236_lib.c
+++ b/sound/isa/cs423x/cs4236_lib.c
@@ -173,7 +173,10 @@ static unsigned char divisor_to_rate_register(unsigned int divisor)
case 2117: return 6;
case 2558: return 7;
default:
- snd_runtime_check(divisor >= 21 && divisor <= 192, return 192);
+ if (divisor < 21 || divisor > 192) {
+ snd_BUG();
+ return 192;
+ }
return divisor;
}
}