Skip to content

Commit a47a3b7

Browse files
hadessbentiss
authored andcommitted
HID: logitech-hidpp: Add more debug statements
This should help us figure out some hairy problems with some devices. Signed-off-by: Bastien Nocera <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Benjamin Tissoires <[email protected]>
1 parent e8ab7a1 commit a47a3b7

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

drivers/hid/hid-logitech-hidpp.c

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -338,8 +338,13 @@ static int hidpp_send_fap_command_sync(struct hidpp_device *hidpp,
338338
struct hidpp_report *message;
339339
int ret;
340340

341-
if (param_count > sizeof(message->fap.params))
341+
if (param_count > sizeof(message->fap.params)) {
342+
hid_dbg(hidpp->hid_dev,
343+
"Invalid number of parameters passed to command (%d != %llu)\n",
344+
param_count,
345+
(unsigned long long) sizeof(message->fap.params));
342346
return -EINVAL;
347+
}
343348

344349
message = kzalloc(sizeof(struct hidpp_report), GFP_KERNEL);
345350
if (!message)
@@ -3440,11 +3445,17 @@ static int hi_res_scroll_enable(struct hidpp_device *hidpp)
34403445
ret = hidpp10_enable_scrolling_acceleration(hidpp);
34413446
multiplier = 8;
34423447
}
3443-
if (ret)
3448+
if (ret) {
3449+
hid_dbg(hidpp->hid_dev,
3450+
"Could not enable hi-res scrolling: %d\n", ret);
34443451
return ret;
3452+
}
34453453

3446-
if (multiplier == 0)
3454+
if (multiplier == 0) {
3455+
hid_dbg(hidpp->hid_dev,
3456+
"Invalid multiplier 0 from device, setting it to 1\n");
34473457
multiplier = 1;
3458+
}
34483459

34493460
hidpp->vertical_wheel_counter.wheel_multiplier = multiplier;
34503461
hid_dbg(hidpp->hid_dev, "wheel multiplier = %d\n", multiplier);

0 commit comments

Comments
 (0)