]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - sound/ppc/awacs.c
ALSA: Kill snd_assert() in other places
[linux-2.6-omap-h63xx.git] / sound / ppc / awacs.c
index 106c48225bbadd2978a10b325fe80badcc7f086d..7bd33e6552ab813967d44b19aca364801a9a93ba 100644 (file)
@@ -319,7 +319,8 @@ static void awacs_amp_set_master(struct awacs_amp *amp, int vol)
 static void awacs_amp_free(struct snd_pmac *chip)
 {
        struct awacs_amp *amp = chip->mixer_data;
-       snd_assert(amp, return);
+       if (!amp)
+               return;
        kfree(amp);
        chip->mixer_data = NULL;
        chip->mixer_free = NULL;
@@ -345,8 +346,7 @@ static int snd_pmac_awacs_get_volume_amp(struct snd_kcontrol *kcontrol,
        struct snd_pmac *chip = snd_kcontrol_chip(kcontrol);
        int index = kcontrol->private_value;
        struct awacs_amp *amp = chip->mixer_data;
-       snd_assert(amp, return -EINVAL);
-       snd_assert(index >= 0 && index <= 1, return -EINVAL);
+
        ucontrol->value.integer.value[0] = 31 - (amp->amp_vol[index][0] & 31);
        ucontrol->value.integer.value[1] = 31 - (amp->amp_vol[index][1] & 31);
        return 0;
@@ -359,8 +359,6 @@ static int snd_pmac_awacs_put_volume_amp(struct snd_kcontrol *kcontrol,
        int index = kcontrol->private_value;
        int vol[2];
        struct awacs_amp *amp = chip->mixer_data;
-       snd_assert(amp, return -EINVAL);
-       snd_assert(index >= 0 && index <= 1, return -EINVAL);
 
        vol[0] = (31 - (ucontrol->value.integer.value[0] & 31))
                | (amp->amp_vol[index][0] & 32);
@@ -375,8 +373,7 @@ static int snd_pmac_awacs_get_switch_amp(struct snd_kcontrol *kcontrol,
        struct snd_pmac *chip = snd_kcontrol_chip(kcontrol);
        int index = kcontrol->private_value;
        struct awacs_amp *amp = chip->mixer_data;
-       snd_assert(amp, return -EINVAL);
-       snd_assert(index >= 0 && index <= 1, return -EINVAL);
+
        ucontrol->value.integer.value[0] = (amp->amp_vol[index][0] & 32)
                                        ? 0 : 1;
        ucontrol->value.integer.value[1] = (amp->amp_vol[index][1] & 32)
@@ -391,8 +388,6 @@ static int snd_pmac_awacs_put_switch_amp(struct snd_kcontrol *kcontrol,
        int index = kcontrol->private_value;
        int vol[2];
        struct awacs_amp *amp = chip->mixer_data;
-       snd_assert(amp, return -EINVAL);
-       snd_assert(index >= 0 && index <= 1, return -EINVAL);
 
        vol[0] = (ucontrol->value.integer.value[0] ? 0 : 32)
                | (amp->amp_vol[index][0] & 31);
@@ -417,8 +412,7 @@ static int snd_pmac_awacs_get_tone_amp(struct snd_kcontrol *kcontrol,
        struct snd_pmac *chip = snd_kcontrol_chip(kcontrol);
        int index = kcontrol->private_value;
        struct awacs_amp *amp = chip->mixer_data;
-       snd_assert(amp, return -EINVAL);
-       snd_assert(index >= 0 && index <= 1, return -EINVAL);
+
        ucontrol->value.integer.value[0] = amp->amp_tone[index];
        return 0;
 }
@@ -430,8 +424,7 @@ static int snd_pmac_awacs_put_tone_amp(struct snd_kcontrol *kcontrol,
        int index = kcontrol->private_value;
        struct awacs_amp *amp = chip->mixer_data;
        unsigned int val;
-       snd_assert(amp, return -EINVAL);
-       snd_assert(index >= 0 && index <= 1, return -EINVAL);
+
        val = ucontrol->value.integer.value[0];
        if (val > 14)
                return -EINVAL;
@@ -458,7 +451,7 @@ static int snd_pmac_awacs_get_master_amp(struct snd_kcontrol *kcontrol,
 {
        struct snd_pmac *chip = snd_kcontrol_chip(kcontrol);
        struct awacs_amp *amp = chip->mixer_data;
-       snd_assert(amp, return -EINVAL);
+
        ucontrol->value.integer.value[0] = amp->amp_master;
        return 0;
 }
@@ -469,7 +462,7 @@ static int snd_pmac_awacs_put_master_amp(struct snd_kcontrol *kcontrol,
        struct snd_pmac *chip = snd_kcontrol_chip(kcontrol);
        struct awacs_amp *amp = chip->mixer_data;
        unsigned int val;
-       snd_assert(amp, return -EINVAL);
+
        val = ucontrol->value.integer.value[0];
        if (val > 99)
                return -EINVAL;