diff options
Diffstat (limited to 'usr/src/dkms_source_tree/hid-ntrig.c')
| -rw-r--r-- | usr/src/dkms_source_tree/hid-ntrig.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/usr/src/dkms_source_tree/hid-ntrig.c b/usr/src/dkms_source_tree/hid-ntrig.c index 0fab58b..9e6b91e 100644 --- a/usr/src/dkms_source_tree/hid-ntrig.c +++ b/usr/src/dkms_source_tree/hid-ntrig.c | |||
| @@ -332,8 +332,19 @@ static void report_frame(struct input_dev *input, struct ntrig_data *nd) | |||
| 332 | static int ntrig_event (struct hid_device *hid, struct hid_field *field, | 332 | static int ntrig_event (struct hid_device *hid, struct hid_field *field, |
| 333 | struct hid_usage *usage, __s32 value) | 333 | struct hid_usage *usage, __s32 value) |
| 334 | { | 334 | { |
| 335 | struct input_dev *input = field->hidinput->input; | ||
| 336 | struct ntrig_data *nd = hid_get_drvdata(hid); | 335 | struct ntrig_data *nd = hid_get_drvdata(hid); |
| 336 | struct input_dev *input; | ||
| 337 | |||
| 338 | /* Skip processing if not a claimed input */ | ||
| 339 | if (!(hid->claimed & HID_CLAIMED_INPUT)) | ||
| 340 | goto not_claimed_input; | ||
| 341 | |||
| 342 | /* This function is being called before the structures are fully | ||
| 343 | * initialized */ | ||
| 344 | if(!(field->hidinput && field->hidinput->input)) | ||
| 345 | return -EINVAL; | ||
| 346 | |||
| 347 | input = field->hidinput->input; | ||
| 337 | 348 | ||
| 338 | /* No special handling needed for the pen */ | 349 | /* No special handling needed for the pen */ |
| 339 | if (field->application == HID_DG_PEN) | 350 | if (field->application == HID_DG_PEN) |
| @@ -377,6 +388,8 @@ static int ntrig_event (struct hid_device *hid, struct hid_field *field, | |||
| 377 | } | 388 | } |
| 378 | } | 389 | } |
| 379 | 390 | ||
| 391 | not_claimed_input: | ||
| 392 | |||
| 380 | /* we have handled the hidinput part, now remains hiddev */ | 393 | /* we have handled the hidinput part, now remains hiddev */ |
| 381 | if ((hid->claimed & HID_CLAIMED_HIDDEV) && hid->hiddev_hid_event) | 394 | if ((hid->claimed & HID_CLAIMED_HIDDEV) && hid->hiddev_hid_event) |
| 382 | hid->hiddev_hid_event(hid, field, usage, value); | 395 | hid->hiddev_hid_event(hid, field, usage, value); |
