From dce7d84b529a6e2a8f02da28896d9f1f8cdbd44b Mon Sep 17 00:00:00 2001 From: Dmitry Torokhov Date: Tue, 15 Dec 2009 16:26:53 -0800 Subject: [PATCH] --- yaml --- r: 177089 b: refs/heads/master c: 18f7ad59b0ef341fb9390cb79b2a39707c48257d h: refs/heads/master i: 177087: dc48cf8df888dcc63b5d8c29b905b43a8296a304 v: v3 --- [refs] | 2 +- trunk/drivers/char/keyboard.c | 10 +++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/[refs] b/[refs] index a5bbedea1ca1..88f483bd3c08 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 909275bc1b42b4f4505ccbe193b111e9d1c5816f +refs/heads/master: 18f7ad59b0ef341fb9390cb79b2a39707c48257d diff --git a/trunk/drivers/char/keyboard.c b/trunk/drivers/char/keyboard.c index 5619007e7e05..f706b1dffdb3 100644 --- a/trunk/drivers/char/keyboard.c +++ b/trunk/drivers/char/keyboard.c @@ -233,7 +233,8 @@ int setkeycode(unsigned int scancode, unsigned int keycode) } /* - * Making beeps and bells. + * Making beeps and bells. Note that we prefer beeps to bells, but when + * shutting the sound off we do both. */ 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) struct input_dev *dev = handle->dev; if (test_bit(EV_SND, dev->evbit)) { - if (test_bit(SND_TONE, dev->sndbit)) + if (test_bit(SND_TONE, dev->sndbit)) { input_inject_event(handle, EV_SND, SND_TONE, *hz); - if (test_bit(SND_BELL, handle->dev->sndbit)) + if (*hz) + return 0; + } + if (test_bit(SND_BELL, dev->sndbit)) input_inject_event(handle, EV_SND, SND_BELL, *hz ? 1 : 0); }