Skip to content

Commit 044fa81

Browse files
spbnickJiri Kosina
authored andcommitted
HID: uclogic: Handle virtual frame reports
Explicitly change report ID to virtual ID and handle virtual frame reports as real for consistency. Signed-off-by: Nikolai Kondrashov <spbnick@gmail.com> Signed-off-by: José Expósito <jose.exposito89@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
1 parent fea53b9 commit 044fa81

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

drivers/hid/hid-uclogic-core.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -365,6 +365,7 @@ static int uclogic_raw_event(struct hid_device *hdev,
365365
struct hid_report *report,
366366
u8 *data, int size)
367367
{
368+
unsigned int report_id = report->id;
368369
struct uclogic_drvdata *drvdata = hid_get_drvdata(hdev);
369370
struct uclogic_params *params = &drvdata->params;
370371

@@ -374,20 +375,20 @@ static int uclogic_raw_event(struct hid_device *hdev,
374375

375376
/* Tweak pen reports, if necessary */
376377
if (!params->pen_unused &&
377-
(report->id == params->pen.id) &&
378+
(report_id == params->pen.id) &&
378379
(size >= 2)) {
379380
/* If it's the "virtual" frame controls report */
380381
if (params->frame.id != 0 &&
381382
data[1] & params->pen_frame_flag) {
382383
/* Change to virtual frame controls report ID */
383-
data[0] = params->frame.id;
384-
return 0;
384+
report_id = data[0] = params->frame.id;
385+
} else {
386+
return uclogic_raw_event_pen(drvdata, data, size);
385387
}
386-
return uclogic_raw_event_pen(drvdata, data, size);
387388
}
388389

389390
/* Tweak frame control reports, if necessary */
390-
if (report->id == params->frame.id)
391+
if (report_id == params->frame.id)
391392
return uclogic_raw_event_frame(drvdata, data, size);
392393

393394
return 0;

0 commit comments

Comments
 (0)