ALSA: Kill snd_assert() in other places
Kill snd_assert() in other places, either removed or replaced with if () with snd_BUG_ON(). Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
This commit is contained in:

committed by
Jaroslav Kysela

parent
da3cec35dd
commit
5e246b850d
@@ -263,7 +263,7 @@ static int tumbler_get_master_volume(struct snd_kcontrol *kcontrol,
|
||||
{
|
||||
struct snd_pmac *chip = snd_kcontrol_chip(kcontrol);
|
||||
struct pmac_tumbler *mix = chip->mixer_data;
|
||||
snd_assert(mix, return -ENODEV);
|
||||
|
||||
ucontrol->value.integer.value[0] = mix->master_vol[0];
|
||||
ucontrol->value.integer.value[1] = mix->master_vol[1];
|
||||
return 0;
|
||||
@@ -277,7 +277,6 @@ static int tumbler_put_master_volume(struct snd_kcontrol *kcontrol,
|
||||
unsigned int vol[2];
|
||||
int change;
|
||||
|
||||
snd_assert(mix, return -ENODEV);
|
||||
vol[0] = ucontrol->value.integer.value[0];
|
||||
vol[1] = ucontrol->value.integer.value[1];
|
||||
if (vol[0] >= ARRAY_SIZE(master_volume_table) ||
|
||||
@@ -299,7 +298,7 @@ static int tumbler_get_master_switch(struct snd_kcontrol *kcontrol,
|
||||
{
|
||||
struct snd_pmac *chip = snd_kcontrol_chip(kcontrol);
|
||||
struct pmac_tumbler *mix = chip->mixer_data;
|
||||
snd_assert(mix, return -ENODEV);
|
||||
|
||||
ucontrol->value.integer.value[0] = mix->master_switch[0];
|
||||
ucontrol->value.integer.value[1] = mix->master_switch[1];
|
||||
return 0;
|
||||
@@ -312,7 +311,6 @@ static int tumbler_put_master_switch(struct snd_kcontrol *kcontrol,
|
||||
struct pmac_tumbler *mix = chip->mixer_data;
|
||||
int change;
|
||||
|
||||
snd_assert(mix, return -ENODEV);
|
||||
change = mix->master_switch[0] != ucontrol->value.integer.value[0] ||
|
||||
mix->master_switch[1] != ucontrol->value.integer.value[1];
|
||||
if (change) {
|
||||
@@ -807,7 +805,6 @@ static int snapper_get_capture_source(struct snd_kcontrol *kcontrol,
|
||||
struct snd_pmac *chip = snd_kcontrol_chip(kcontrol);
|
||||
struct pmac_tumbler *mix = chip->mixer_data;
|
||||
|
||||
snd_assert(mix, return -ENODEV);
|
||||
ucontrol->value.enumerated.item[0] = mix->capture_source;
|
||||
return 0;
|
||||
}
|
||||
@@ -819,7 +816,6 @@ static int snapper_put_capture_source(struct snd_kcontrol *kcontrol,
|
||||
struct pmac_tumbler *mix = chip->mixer_data;
|
||||
int change;
|
||||
|
||||
snd_assert(mix, return -ENODEV);
|
||||
change = ucontrol->value.enumerated.item[0] != mix->capture_source;
|
||||
if (change) {
|
||||
mix->capture_source = !!ucontrol->value.enumerated.item[0];
|
||||
@@ -978,7 +974,8 @@ static void device_change_handler(struct work_struct *work)
|
||||
return;
|
||||
|
||||
mix = chip->mixer_data;
|
||||
snd_assert(mix, return);
|
||||
if (snd_BUG_ON(!mix))
|
||||
return;
|
||||
|
||||
headphone = tumbler_detect_headphone(chip);
|
||||
lineout = tumbler_detect_lineout(chip);
|
||||
@@ -1033,7 +1030,8 @@ static void tumbler_update_automute(struct snd_pmac *chip, int do_notify)
|
||||
if (chip->auto_mute) {
|
||||
struct pmac_tumbler *mix;
|
||||
mix = chip->mixer_data;
|
||||
snd_assert(mix, return);
|
||||
if (snd_BUG_ON(!mix))
|
||||
return;
|
||||
mix->auto_mute_notify = do_notify;
|
||||
schedule_work(&device_change);
|
||||
}
|
||||
@@ -1227,8 +1225,6 @@ static void tumbler_resume(struct snd_pmac *chip)
|
||||
{
|
||||
struct pmac_tumbler *mix = chip->mixer_data;
|
||||
|
||||
snd_assert(mix, return);
|
||||
|
||||
mix->acs &= ~1;
|
||||
mix->master_switch[0] = mix->save_master_switch[0];
|
||||
mix->master_switch[1] = mix->save_master_switch[1];
|
||||
@@ -1275,7 +1271,6 @@ static int __init tumbler_init(struct snd_pmac *chip)
|
||||
{
|
||||
int irq;
|
||||
struct pmac_tumbler *mix = chip->mixer_data;
|
||||
snd_assert(mix, return -EINVAL);
|
||||
|
||||
if (tumbler_find_device("audio-hw-reset",
|
||||
"platform-do-hw-reset",
|
||||
|
Reference in New Issue
Block a user