aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/char')
-rw-r--r--drivers/char/keyboard.c10
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
239static int kd_sound_helper(struct input_handle *handle, void *data) 240static 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