Skip to content

Commit f3c4ee7

Browse files
jwrdegoedeBenjamin Tissoires
authored andcommitted
HID: logitech-hidpp: Drop delayed_work_cb()
Drop delayed_work_cb() instead make hidpp_connect_event() the workqueue function itself. Besides resulting in a small cleanup this will hopefully also make it clearer that going forward hidpp_connect_event() should only be run from a workqueue and not be directly invoked. This series has been tested on the following devices: Logitech Bluetooth Laser Travel Mouse (bluetooth, HID++ 1.0) Logitech M720 Triathlon (bluetooth, HID++ 4.5) Logitech M720 Triathlon (unifying, HID++ 4.5) Logitech K400 Pro (unifying, HID++ 4.1) Logitech K270 (eQUAD nano Lite, HID++ 2.0) Logitech M185 (eQUAD nano Lite, HID++ 4.5) Logitech LX501 keyboard (27 Mhz, HID++ builtin scroll-wheel, HID++ 1.0) Logitech M-RAZ105 mouse (27 Mhz, HID++ extra mouse buttons, HID++ 1.0) And by bentiss: Logitech Touchpad T650 (unifying) Logitech Touchpad T651 (bluetooth) Logitech MX Master 3B (BLE) Logitech G403 (plain USB / Gaming receiver) Signed-off-by: Hans de Goede <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Benjamin Tissoires <[email protected]>
1 parent 680ee41 commit f3c4ee7

File tree

1 file changed

+3
-11
lines changed

1 file changed

+3
-11
lines changed

drivers/hid/hid-logitech-hidpp.c

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -234,8 +234,6 @@ struct hidpp_device {
234234
#define HIDPP20_ERROR_UNSUPPORTED 0x09
235235
#define HIDPP20_ERROR 0xff
236236

237-
static void hidpp_connect_event(struct hidpp_device *hidpp_dev);
238-
239237
static int __hidpp_send_report(struct hid_device *hdev,
240238
struct hidpp_report *hidpp_report)
241239
{
@@ -449,13 +447,6 @@ static int hidpp_send_rap_command_sync(struct hidpp_device *hidpp_dev,
449447
return ret;
450448
}
451449

452-
static void delayed_work_cb(struct work_struct *work)
453-
{
454-
struct hidpp_device *hidpp = container_of(work, struct hidpp_device,
455-
work);
456-
hidpp_connect_event(hidpp);
457-
}
458-
459450
static inline bool hidpp_match_answer(struct hidpp_report *question,
460451
struct hidpp_report *answer)
461452
{
@@ -4183,8 +4174,9 @@ static struct input_dev *hidpp_allocate_input(struct hid_device *hdev)
41834174
return input_dev;
41844175
}
41854176

4186-
static void hidpp_connect_event(struct hidpp_device *hidpp)
4177+
static void hidpp_connect_event(struct work_struct *work)
41874178
{
4179+
struct hidpp_device *hidpp = container_of(work, struct hidpp_device, work);
41884180
struct hid_device *hdev = hidpp->hid_dev;
41894181
struct input_dev *input;
41904182
char *name, *devm_name;
@@ -4435,7 +4427,7 @@ static int hidpp_probe(struct hid_device *hdev, const struct hid_device_id *id)
44354427
return ret;
44364428
}
44374429

4438-
INIT_WORK(&hidpp->work, delayed_work_cb);
4430+
INIT_WORK(&hidpp->work, hidpp_connect_event);
44394431
mutex_init(&hidpp->send_mutex);
44404432
init_waitqueue_head(&hidpp->wait);
44414433

0 commit comments

Comments
 (0)