aboutsummaryrefslogtreecommitdiffstats
path: root/sound/ppc/tumbler.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/ppc/tumbler.c')
-rw-r--r--sound/ppc/tumbler.c17
1 files changed, 6 insertions, 11 deletions
diff --git a/sound/ppc/tumbler.c b/sound/ppc/tumbler.c
index 009df8dd37a8..f746e15b8481 100644
--- a/sound/ppc/tumbler.c
+++ b/sound/ppc/tumbler.c
@@ -263,7 +263,7 @@ static int tumbler_get_master_volume(struct snd_kcontrol *kcontrol,
263{ 263{
264 struct snd_pmac *chip = snd_kcontrol_chip(kcontrol); 264 struct snd_pmac *chip = snd_kcontrol_chip(kcontrol);
265 struct pmac_tumbler *mix = chip->mixer_data; 265 struct pmac_tumbler *mix = chip->mixer_data;
266 snd_assert(mix, return -ENODEV); 266
267 ucontrol->value.integer.value[0] = mix->master_vol[0]; 267 ucontrol->value.integer.value[0] = mix->master_vol[0];
268 ucontrol->value.integer.value[1] = mix->master_vol[1]; 268 ucontrol->value.integer.value[1] = mix->master_vol[1];
269 return 0; 269 return 0;
@@ -277,7 +277,6 @@ static int tumbler_put_master_volume(struct snd_kcontrol *kcontrol,
277 unsigned int vol[2]; 277 unsigned int vol[2];
278 int change; 278 int change;
279 279
280 snd_assert(mix, return -ENODEV);
281 vol[0] = ucontrol->value.integer.value[0]; 280 vol[0] = ucontrol->value.integer.value[0];
282 vol[1] = ucontrol->value.integer.value[1]; 281 vol[1] = ucontrol->value.integer.value[1];
283 if (vol[0] >= ARRAY_SIZE(master_volume_table) || 282 if (vol[0] >= ARRAY_SIZE(master_volume_table) ||
@@ -299,7 +298,7 @@ static int tumbler_get_master_switch(struct snd_kcontrol *kcontrol,
299{ 298{
300 struct snd_pmac *chip = snd_kcontrol_chip(kcontrol); 299 struct snd_pmac *chip = snd_kcontrol_chip(kcontrol);
301 struct pmac_tumbler *mix = chip->mixer_data; 300 struct pmac_tumbler *mix = chip->mixer_data;
302 snd_assert(mix, return -ENODEV); 301
303 ucontrol->value.integer.value[0] = mix->master_switch[0]; 302 ucontrol->value.integer.value[0] = mix->master_switch[0];
304 ucontrol->value.integer.value[1] = mix->master_switch[1]; 303 ucontrol->value.integer.value[1] = mix->master_switch[1];
305 return 0; 304 return 0;
@@ -312,7 +311,6 @@ static int tumbler_put_master_switch(struct snd_kcontrol *kcontrol,
312 struct pmac_tumbler *mix = chip->mixer_data; 311 struct pmac_tumbler *mix = chip->mixer_data;
313 int change; 312 int change;
314 313
315 snd_assert(mix, return -ENODEV);
316 change = mix->master_switch[0] != ucontrol->value.integer.value[0] || 314 change = mix->master_switch[0] != ucontrol->value.integer.value[0] ||
317 mix->master_switch[1] != ucontrol->value.integer.value[1]; 315 mix->master_switch[1] != ucontrol->value.integer.value[1];
318 if (change) { 316 if (change) {
@@ -807,7 +805,6 @@ static int snapper_get_capture_source(struct snd_kcontrol *kcontrol,
807 struct snd_pmac *chip = snd_kcontrol_chip(kcontrol); 805 struct snd_pmac *chip = snd_kcontrol_chip(kcontrol);
808 struct pmac_tumbler *mix = chip->mixer_data; 806 struct pmac_tumbler *mix = chip->mixer_data;
809 807
810 snd_assert(mix, return -ENODEV);
811 ucontrol->value.enumerated.item[0] = mix->capture_source; 808 ucontrol->value.enumerated.item[0] = mix->capture_source;
812 return 0; 809 return 0;
813} 810}
@@ -819,7 +816,6 @@ static int snapper_put_capture_source(struct snd_kcontrol *kcontrol,
819 struct pmac_tumbler *mix = chip->mixer_data; 816 struct pmac_tumbler *mix = chip->mixer_data;
820 int change; 817 int change;
821 818
822 snd_assert(mix, return -ENODEV);
823 change = ucontrol->value.enumerated.item[0] != mix->capture_source; 819 change = ucontrol->value.enumerated.item[0] != mix->capture_source;
824 if (change) { 820 if (change) {
825 mix->capture_source = !!ucontrol->value.enumerated.item[0]; 821 mix->capture_source = !!ucontrol->value.enumerated.item[0];
@@ -978,7 +974,8 @@ static void device_change_handler(struct work_struct *work)
978 return; 974 return;
979 975
980 mix = chip->mixer_data; 976 mix = chip->mixer_data;
981 snd_assert(mix, return); 977 if (snd_BUG_ON(!mix))
978 return;
982 979
983 headphone = tumbler_detect_headphone(chip); 980 headphone = tumbler_detect_headphone(chip);
984 lineout = tumbler_detect_lineout(chip); 981 lineout = tumbler_detect_lineout(chip);
@@ -1033,7 +1030,8 @@ static void tumbler_update_automute(struct snd_pmac *chip, int do_notify)
1033 if (chip->auto_mute) { 1030 if (chip->auto_mute) {
1034 struct pmac_tumbler *mix; 1031 struct pmac_tumbler *mix;
1035 mix = chip->mixer_data; 1032 mix = chip->mixer_data;
1036 snd_assert(mix, return); 1033 if (snd_BUG_ON(!mix))
1034 return;
1037 mix->auto_mute_notify = do_notify; 1035 mix->auto_mute_notify = do_notify;
1038 schedule_work(&device_change); 1036 schedule_work(&device_change);
1039 } 1037 }
@@ -1227,8 +1225,6 @@ static void tumbler_resume(struct snd_pmac *chip)
1227{ 1225{
1228 struct pmac_tumbler *mix = chip->mixer_data; 1226 struct pmac_tumbler *mix = chip->mixer_data;
1229 1227
1230 snd_assert(mix, return);
1231
1232 mix->acs &= ~1; 1228 mix->acs &= ~1;
1233 mix->master_switch[0] = mix->save_master_switch[0]; 1229 mix->master_switch[0] = mix->save_master_switch[0];
1234 mix->master_switch[1] = mix->save_master_switch[1]; 1230 mix->master_switch[1] = mix->save_master_switch[1];
@@ -1275,7 +1271,6 @@ static int __init tumbler_init(struct snd_pmac *chip)
1275{ 1271{
1276 int irq; 1272 int irq;
1277 struct pmac_tumbler *mix = chip->mixer_data; 1273 struct pmac_tumbler *mix = chip->mixer_data;
1278 snd_assert(mix, return -EINVAL);
1279 1274
1280 if (tumbler_find_device("audio-hw-reset", 1275 if (tumbler_find_device("audio-hw-reset",
1281 "platform-do-hw-reset", 1276 "platform-do-hw-reset",