aboutsummaryrefslogtreecommitdiffstats
path: root/sound/ppc/beep.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/ppc/beep.c')
-rw-r--r--sound/ppc/beep.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sound/ppc/beep.c b/sound/ppc/beep.c
index baa2a7237370..89f5c328acfe 100644
--- a/sound/ppc/beep.c
+++ b/sound/ppc/beep.c
@@ -185,7 +185,8 @@ static int snd_pmac_get_beep(struct snd_kcontrol *kcontrol,
185 struct snd_ctl_elem_value *ucontrol) 185 struct snd_ctl_elem_value *ucontrol)
186{ 186{
187 struct snd_pmac *chip = snd_kcontrol_chip(kcontrol); 187 struct snd_pmac *chip = snd_kcontrol_chip(kcontrol);
188 snd_assert(chip->beep, return -ENXIO); 188 if (snd_BUG_ON(!chip->beep))
189 return -ENXIO;
189 ucontrol->value.integer.value[0] = chip->beep->volume; 190 ucontrol->value.integer.value[0] = chip->beep->volume;
190 return 0; 191 return 0;
191} 192}
@@ -195,7 +196,8 @@ static int snd_pmac_put_beep(struct snd_kcontrol *kcontrol,
195{ 196{
196 struct snd_pmac *chip = snd_kcontrol_chip(kcontrol); 197 struct snd_pmac *chip = snd_kcontrol_chip(kcontrol);
197 unsigned int oval, nval; 198 unsigned int oval, nval;
198 snd_assert(chip->beep, return -ENXIO); 199 if (snd_BUG_ON(!chip->beep))
200 return -ENXIO;
199 oval = chip->beep->volume; 201 oval = chip->beep->volume;
200 nval = ucontrol->value.integer.value[0]; 202 nval = ucontrol->value.integer.value[0];
201 if (nval > 100) 203 if (nval > 100)