summaryrefslogtreecommitdiffstats
path: root/drivers/hid/hid-input-quirks.c
diff options
context:
space:
mode:
authorJiri Kosina <jkosina@suse.cz>2008-02-07 16:48:46 +0100
committerJiri Kosina <jkosina@suse.cz>2008-02-11 13:01:51 +0100
commit68a1f2cc8676f22a6fd49f344f99e326eb7f5117 (patch)
treed71703b0cbb0f13b8b183e8d512872e8ef763ed5 /drivers/hid/hid-input-quirks.c
parentdda3fd3535566b4d2b450dded23f1334a5f60bd6 (diff)
downloadtalos-obmc-linux-68a1f2cc8676f22a6fd49f344f99e326eb7f5117.tar.gz
talos-obmc-linux-68a1f2cc8676f22a6fd49f344f99e326eb7f5117.zip
HID: fix processing of event quirks
The old code (before move) stopped further processing of the event after it has been already processed by the quirk handler. The new code didn't propagate the return value properly, and therefore the processing always proceeded, which was wrong. This patch fixes it. Pointed out in kernel.org bugzilla #9842 Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers/hid/hid-input-quirks.c')
-rw-r--r--drivers/hid/hid-input-quirks.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/drivers/hid/hid-input-quirks.c b/drivers/hid/hid-input-quirks.c
index a870ba58faa3..dceadd0c1419 100644
--- a/drivers/hid/hid-input-quirks.c
+++ b/drivers/hid/hid-input-quirks.c
@@ -352,7 +352,7 @@ int hidinput_mapping_quirks(struct hid_usage *usage,
return 0;
}
-void hidinput_event_quirks(struct hid_device *hid, struct hid_field *field, struct hid_usage *usage, __s32 value)
+int hidinput_event_quirks(struct hid_device *hid, struct hid_field *field, struct hid_usage *usage, __s32 value)
{
struct input_dev *input;
@@ -362,34 +362,34 @@ void hidinput_event_quirks(struct hid_device *hid, struct hid_field *field, stru
|| ((hid->quirks & HID_QUIRK_2WHEEL_MOUSE_HACK_7) && (usage->hid == 0x00090007))) {
if (value) hid->quirks |= HID_QUIRK_2WHEEL_MOUSE_HACK_ON;
else hid->quirks &= ~HID_QUIRK_2WHEEL_MOUSE_HACK_ON;
- return;
+ return 1;
}
if ((hid->quirks & HID_QUIRK_2WHEEL_MOUSE_HACK_B8) &&
(usage->type == EV_REL) &&
(usage->code == REL_WHEEL)) {
hid->delayed_value = value;
- return;
+ return 1;
}
if ((hid->quirks & HID_QUIRK_2WHEEL_MOUSE_HACK_B8) &&
(usage->hid == 0x000100b8)) {
input_event(input, EV_REL, value ? REL_HWHEEL : REL_WHEEL, hid->delayed_value);
- return;
+ return 1;
}
if ((hid->quirks & HID_QUIRK_INVERT_HWHEEL) && (usage->code == REL_HWHEEL)) {
input_event(input, usage->type, usage->code, -value);
- return;
+ return 1;
}
if ((hid->quirks & HID_QUIRK_2WHEEL_MOUSE_HACK_ON) && (usage->code == REL_WHEEL)) {
input_event(input, usage->type, REL_HWHEEL, value);
- return;
+ return 1;
}
if ((hid->quirks & HID_QUIRK_APPLE_HAS_FN) && hidinput_apple_event(hid, input, usage, value))
- return;
+ return 1;
/* Handling MS keyboards special buttons */
if (hid->quirks & HID_QUIRK_MICROSOFT_KEYS &&
@@ -416,8 +416,9 @@ void hidinput_event_quirks(struct hid_device *hid, struct hid_field *field, stru
if (hid->quirks & HID_QUIRK_HWHEEL_WHEEL_INVERT &&
usage->type == EV_REL && usage->code == REL_HWHEEL) {
input_event(input, usage->type, REL_WHEEL, -value);
- return;
+ return 1;
}
+ return 0;
}
OpenPOWER on IntegriCloud