diff options
author | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2009-12-15 19:26:53 -0500 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2009-12-16 00:48:55 -0500 |
commit | 18f7ad59b0ef341fb9390cb79b2a39707c48257d (patch) | |
tree | df251646709f2d402ec06fe603784f7f46da2de2 | |
parent | 909275bc1b42b4f4505ccbe193b111e9d1c5816f (diff) |
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>
-rw-r--r-- | drivers/char/keyboard.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/drivers/char/keyboard.c b/drivers/char/keyboard.c index 5619007e7e05..f706b1dffdb3 100644 --- a/drivers/char/keyboard.c +++ b/drivers/char/keyboard.c | |||
@@ -233,7 +233,8 @@ int setkeycode(unsigned int scancode, unsigned int keycode) | |||
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 | static int kd_sound_helper(struct input_handle *handle, void *data) | 240 | static int kd_sound_helper(struct input_handle *handle, void *data) |
@@ -242,9 +243,12 @@ static int kd_sound_helper(struct input_handle *handle, void *data) | |||
242 | struct input_dev *dev = handle->dev; | 243 | struct input_dev *dev = handle->dev; |
243 | 244 | ||
244 | if (test_bit(EV_SND, dev->evbit)) { | 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 | input_inject_event(handle, EV_SND, SND_TONE, *hz); | 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 | input_inject_event(handle, EV_SND, SND_BELL, *hz ? 1 : 0); | 252 | input_inject_event(handle, EV_SND, SND_BELL, *hz ? 1 : 0); |
249 | } | 253 | } |
250 | 254 | ||