Commit 18f7ad59b0ef341fb9390cb79b2a39707c48257d

Authored by Dmitry Torokhov
1 parent 909275bc1b

Input: keyboard - don't override beep with a bell

The commit 66d2a5952eab875f1286e04f738ef029afdaf013 introduces a bug:
for every beep requested, a bell is also generated.

Reported-by: Paul Martin <pm@debian.org>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>

Showing 1 changed file with 7 additions and 3 deletions Side-by-side Diff

drivers/char/keyboard.c
... ... @@ -233,7 +233,8 @@
233 233 }
234 234  
235 235 /*
236   - * Making beeps and bells.
  236 + * Making beeps and bells. Note that we prefer beeps to bells, but when
  237 + * shutting the sound off we do both.
237 238 */
238 239  
239 240 static int kd_sound_helper(struct input_handle *handle, void *data)
240 241  
... ... @@ -242,9 +243,12 @@
242 243 struct input_dev *dev = handle->dev;
243 244  
244 245 if (test_bit(EV_SND, dev->evbit)) {
245   - if (test_bit(SND_TONE, dev->sndbit))
  246 + if (test_bit(SND_TONE, dev->sndbit)) {
246 247 input_inject_event(handle, EV_SND, SND_TONE, *hz);
247   - if (test_bit(SND_BELL, handle->dev->sndbit))
  248 + if (*hz)
  249 + return 0;
  250 + }
  251 + if (test_bit(SND_BELL, dev->sndbit))
248 252 input_inject_event(handle, EV_SND, SND_BELL, *hz ? 1 : 0);
249 253 }
250 254