Input: iforce - reformat the packet dump output
authorTim Schumacher <timschumi@gmx.de>
Tue, 24 Jul 2018 17:46:47 +0000 (10:46 -0700)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Fri, 27 Jul 2018 00:04:46 +0000 (17:04 -0700)
commit305180bc05019b60ff7aea0b1d68ddbac205ca1f
tree7331583f35256a55149f4d1fc00829c5a7bda54b
parent179909ecafc3bae1f34289e88bacd45e391f0554
Input: iforce - reformat the packet dump output

Previously, packets that have been dumped are shown in the
kernel log like this:

drivers/input/joystick/iforce/iforce-packets.c: info cmd = ff04, data =
56
02
04
00

Use dev_dbg to dump the packages only when requested and to list
the parent device as well. Use printf logic to generate the hexdump
instead of looping through every char that needs to be printed (which
in turn fixes the unnecessary newlines and looks more clean in general).

The resulting package dump output does now look like this:

usb 2-8: iforce_dump_packet info cmd = ff04, data = 56 02 04 00

Signed-off-by: Tim Schumacher <timschumi@gmx.de>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
drivers/input/joystick/iforce/iforce-ff.c
drivers/input/joystick/iforce/iforce-main.c
drivers/input/joystick/iforce/iforce-packets.c
drivers/input/joystick/iforce/iforce.h