aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hid/hid-gyration.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/hid/hid-gyration.c')
-rw-r--r--drivers/hid/hid-gyration.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/hid/hid-gyration.c b/drivers/hid/hid-gyration.c
index cab13e8c7d29..62416e6baeca 100644
--- a/drivers/hid/hid-gyration.c
+++ b/drivers/hid/hid-gyration.c
@@ -53,10 +53,13 @@ static int gyration_input_mapping(struct hid_device *hdev, struct hid_input *hi,
53static int gyration_event(struct hid_device *hdev, struct hid_field *field, 53static int gyration_event(struct hid_device *hdev, struct hid_field *field,
54 struct hid_usage *usage, __s32 value) 54 struct hid_usage *usage, __s32 value)
55{ 55{
56 struct input_dev *input = field->hidinput->input; 56
57 if (!(hdev->claimed & HID_CLAIMED_INPUT) || !field->hidinput)
58 return 0;
57 59
58 if ((usage->hid & HID_USAGE_PAGE) == HID_UP_GENDESK && 60 if ((usage->hid & HID_USAGE_PAGE) == HID_UP_GENDESK &&
59 (usage->hid & 0xff) == 0x82) { 61 (usage->hid & 0xff) == 0x82) {
62 struct input_dev *input = field->hidinput->input;
60 input_event(input, usage->type, usage->code, 1); 63 input_event(input, usage->type, usage->code, 1);
61 input_sync(input); 64 input_sync(input);
62 input_event(input, usage->type, usage->code, 0); 65 input_event(input, usage->type, usage->code, 0);