HID: i2c-hid: explicitly code setting and sending reports
authorDmitry Torokhov <dmitry.torokhov@gmail.com>
Tue, 18 Jan 2022 07:26:21 +0000 (23:26 -0800)
committerJiri Kosina <jkosina@suse.cz>
Mon, 14 Feb 2022 09:51:07 +0000 (10:51 +0100)
commitdbe0dd5fd2e0c687ad50fc590d5a90400f26adcc
tree0805a8839e768933f75c958dad000b4ede516136
parentb26fc3161b7874ae6300151e652d2d6a15f199f9
HID: i2c-hid: explicitly code setting and sending reports

Instead of relying on __i2c_hid_command() that tries to handle all
commands and because of that is very complicated, let's define a
new dumb helper i2c_hid_xfer() that actually transfers (write and
read) data, and use it when sending and setting reports. By doing
that we can save on number of copy operations we have to execute,
and make logic of sending reports much clearer.

Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Tested-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
drivers/hid/i2c-hid/i2c-hid-core.c