aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hid/hid-logitech-hidpp.c
diff options
context:
space:
mode:
authorBenjamin Tissoires <benjamin.tissoires@redhat.com>2019-04-23 17:52:33 +0200
committerBenjamin Tissoires <benjamin.tissoires@redhat.com>2019-04-23 17:52:33 +0200
commit7d3879bd5da4cc48f41443dcbfa46fcd72c5a354 (patch)
tree7fe5823076dff584878ff809217a42cc8c8d4428 /drivers/hid/hid-logitech-hidpp.c
parentHID: logitech-hidpp: change low battery level threshold from 31 to 30 percent (diff)
parentHID: intel-ish-hid: Add Comet Lake PCI device ID (diff)
downloadlinux-dev-7d3879bd5da4cc48f41443dcbfa46fcd72c5a354.tar.xz
linux-dev-7d3879bd5da4cc48f41443dcbfa46fcd72c5a354.zip
Merge branch 'for-5.1/upstream-fixes' into for-5.2/logitech
Diffstat (limited to 'drivers/hid/hid-logitech-hidpp.c')
-rw-r--r--drivers/hid/hid-logitech-hidpp.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/drivers/hid/hid-logitech-hidpp.c b/drivers/hid/hid-logitech-hidpp.c
index e5897c292e8c..29395da8f345 100644
--- a/drivers/hid/hid-logitech-hidpp.c
+++ b/drivers/hid/hid-logitech-hidpp.c
@@ -2107,6 +2107,13 @@ static int hidpp_ff_init(struct hidpp_device *hidpp, u8 feature_index)
kfree(data);
return -ENOMEM;
}
+ data->wq = create_singlethread_workqueue("hidpp-ff-sendqueue");
+ if (!data->wq) {
+ kfree(data->effect_ids);
+ kfree(data);
+ return -ENOMEM;
+ }
+
data->hidpp = hidpp;
data->feature_index = feature_index;
data->version = version;
@@ -2151,7 +2158,6 @@ static int hidpp_ff_init(struct hidpp_device *hidpp, u8 feature_index)
/* ignore boost value at response.fap.params[2] */
/* init the hardware command queue */
- data->wq = create_singlethread_workqueue("hidpp-ff-sendqueue");
atomic_set(&data->workqueue_size, 0);
/* initialize with zero autocenter to get wheel in usable state */
@@ -2604,8 +2610,9 @@ static int m560_raw_event(struct hid_device *hdev, u8 *data, int size)
input_report_rel(mydata->input, REL_Y, v);
v = hid_snto32(data[6], 8);
- hidpp_scroll_counter_handle_scroll(
- &hidpp->vertical_wheel_counter, v);
+ if (v != 0)
+ hidpp_scroll_counter_handle_scroll(
+ &hidpp->vertical_wheel_counter, v);
input_sync(mydata->input);
}